package/mender: fix sysv startup script
authorAngelo Compagnucci <angelo.compagnucci@gmail.com>
Fri, 15 Feb 2019 21:44:10 +0000 (22:44 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Fri, 15 Feb 2019 22:00:12 +0000 (23:00 +0100)
Mender is a service explicitly written for systemd and so it doesn't
fork on background, doesn't redirect outputs and doesn't create a pid
file by itself.
To make the service running correctly is therefore necessary to use the
-m switch of start-stop-daemon to create the pid file and -b option to
send the process to background.
Logging is preserved because the service will log anyway on syslog.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/mender/S42mender

index 665a9dd74a6dc35fa6fe1b543e187594a9a342db..108fecfea919dbf2dc9554f2c8ed12a06f78b544 100644 (file)
@@ -24,7 +24,7 @@ start() {
        printf "Starting mender service: "
        umask 077
 
-       start-stop-daemon -S -q -p /var/run/mender.pid \
+       start-stop-daemon -S -q -b -m -p /var/run/mender.pid \
                --exec /usr/bin/mender -- -daemon
        [ $? = 0 ] && echo "OK" || echo "FAIL"
 }