あるフリーランスエンジニアの色んなメモ!! ITスキル・ライフハックとか

Nexusをsystemdでサービス化する

サーバーを起動する度にNexusを手動で起動するのは面倒なため、
以下の手順でNexusの自動で起動させる設定を行う


systemd設定ファイルの作成

vi /etc/systemd/system/nexus.service
[Unit]
Description=nexus service
After=network.target

[Service]
Type=forking
ExecStart=/opt/sonatype/nexus/bin/nexus start
ExecStop=/opt/sonatype/nexus/bin/nexus stop
User=nexus
Restart=on-abort

[Install]
WantedBy=multi-user.target

systemd設定ファイルの変更を反映

systemctl daemon-reload

Nexusの自動起動を有効化

systemctl enable nexus.service

Nexusを起動

systemctl start nexus.service
comments powered by Disqus