I am trying to run CouchPotato as a daemon at startup on my openSuSE 12.2 box.
I have put together this script based on what works for sabnzbd and sickbeard, put it in /etc/init.d/couchpotato, chmod 755 and calling it using “/etc/init.d/couchpotato start”
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: couchpotato
# Required-Start: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Starts Couch Potato at system startup
### END INIT INFO
#
. /etc/rc.status
rc_reset
case "$1" in
start)
echo "Starting Couch Potato."
/usr/bin/sudo -u user -H "/home/user/CouchPotato-ff2b275/CouchPotato.py"
rc_status -v
;;
stop)
echo "Shutting down Couch Potato."
/usr/bin/env wget -q --delete-after "http://localhost:5000/config/exit/"
rc_status -v
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
And this is the error I am getting when trying to launch it
downloader:~ # /etc/init.d/couchpotato start
redirecting to systemctl
Job failed. See system journal and 'systemctl status' for details.
System journal has this to say:
Sep 29 11:18:12 downloader[2433]: Failed at step EXEC spawning /etc/init.d/couchpotato: Exec format error
Sep 29 11:18:12 downloader systemd[1]: couchpotato.service: control process exited, code=exited status=203
Sep 29 11:18:12 downloader systemd[1]: Unit couchpotato.service entered failed state.
Can I convert sabnzbd and sickbeard that I was launching using a script in /etc/init.d to systemd? Should I use the example above as a framework and replace paths accordingly?
systemd seems to be more suited to daemonizing programs.
Hi
You should be able to use it as an example, there are many more
options/ways with systemd. If they work, consider pushing them back to
the developers to review/include in their source.
–
Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.6-2.10-desktop
up 2:05, 3 users, load average: 0.03, 0.16, 0.20
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU
Hi
openSUSE is moving towards systemd rather than sysVinit there may be
limited support for it in the next release, but current talk on the
development mailing list is for it to be dropped for 12.3.
I would say systemd is preferred
–
Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.6-2.10-desktop
up 10:59, 3 users, load average: 0.01, 0.07, 0.06
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU