Skip to contentSkip to conversation

package/mender: fix sysv startup script

PATCH New Angelo Compagnucci 2 participants 2 messages Feb 15, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/mender: fix sysv startup script

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.

---
 package/mender/S42mender | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/mender/S42mender +1 -1
index 665a9dd74a..108fecfea9 100644
@@ -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"
 }
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 package/mender: fix sysv startup script

Quoted 8 lines · On Fri, 15 Feb 2019 22:44:10 +0100 Angelo Compagnucci…

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.

Quoted 4 lines
---
 package/mender/S42mender | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com