I used the suggested answer from this post to make a custom service in my ubuntu 17.04 environment: Installing gitblit GO as service in Ubuntu Server 16.04
Unfortunately when I hit
sudo systemctl enable gitblit_server.service
I receive
Failed to enable unit: File gitblit_server.service: Invalid argument
as an error.
Any idea what I am doing wrong?
Update:
result for journalctl -xe
Sep 01 16:06:22 git-dmz01 sudo[7121]: msoadmin : TTY=pts/1 ; PWD=/etc/systemd/system ; USER=root ; COMMAND=/bin/systemctl enable gitblit_server.service
Sep 01 16:06:22 git-dmz01 sudo[7121]: pam_unix(sudo:session): session opened for user root by msoadmin(uid=0)
Sep 01 16:06:22 git-dmz01 systemd[1]: [/etc/systemd/system/gitblit_server.service:12] Missing '='.
Sep 01 16:06:22 git-dmz01 sudo[7121]: pam_unix(sudo:session): session closed for user root
content of my file gitblit_server.service:
[Unit]
Description=gitblit Server CVS
After=network.target
[Service]
User=msoadmin
Type=simple
WorkingDirectory=/opt/gitblit
PIDFile=/var/run/gitblit.service.pid
ExecStartPre=/opt/gitblit/java-proxy-config.sh
ExecStart=/usr/bin/java -server -Xmx1024M -Djava.awt.headless=true -jar
/opt/gitblit/gitblit.jar --baseFolder /opt/gitblit/data --dailyLogFile
[Install]
WantedBy=multi-user.target
/lib/systemd/system
, rather you'd use/etc/systemd/system/your_custom_file.service
. Secondly, after creating the service file you'd runsystemct daemon-reload
to notify systemd about your newly created file. Make sure you've restoredSELinux
file context and so on.restorecon -RFvv /etc/systemd/system
. Also make sure you have assigned the right permissions to the filechmod 664 /etc/systemd/system/gitblit_server.service
journalctl -xe
shows