So I wrote a golang app which I want initialized by
systemd whenever my server gets a reboot.
Here's the service file:-
[Unit] Description=golang wiki initialization [Service] Type=forking PIDFile=/tmp/gowiki.pid-3030 User=root Group=root WorkingDirectory=/var/www ExecStart=/bin/bash -c 'daemonize -o stdout.log -e stderr.log /var/www/wiki' [Install] WantedBy=multi-user.target
It appears to work well whenever I reboot the server but I am still running into slightly irritating problem when I am manually starting or restarting
gowiki like this in terminal:-
systemctl start gowiki
systemctl restart gowiki
This does get my gowiki process running; however, after I execute my
systemctl start gowiki command, I am frozen in my terminal and the command does not seem to exit until I manually force a Ctrl-C.
What am I doing wrong to be causing this problem?