Alpine Linux /etc/init.d daemon script #1037
Unanswered
nicedevil007
asked this question in
Q&A
Replies: 3 comments 6 replies
-
I'm really not familiar with lxc, but the the first things I would check are:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I think you need a |
Beta Was this translation helpful? Give feedback.
0 replies
-
I tried a new version now... The issue is that blocky always sends everything to the console output so it is not running in the background. #!/bin/sh
### BEGIN INIT INFO
# Provides: blocky
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start script for Blocky
### END INIT INFO
# Benutzer, unter dem Blocky ausgeführt werden soll
#USER="blockyservice"
USER="root"
# Blocky-Startbefehl
START_COMMAND="/usr/bin/blocky --config /root/config.yml"
# Funktion zum Starten von Blocky
start_blocky() {
su -c "${START_COMMAND}" -s /bin/sh $USER
}
# Funktion zum Stoppen von Blocky
stop_blocky() {
pkill -f "${START_COMMAND}"
}
case "$1" in
start)
start_blocky
;;
stop)
stop_blocky
;;
restart)
stop_blocky
sleep 1
start_blocky
;;
*)
echo "Verwendung: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0 |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys, I recently installed blockly under Alpine Linux to have the smallest LXC container possible for using this tool. Unfortunately the package didn't come with an /etc/init.d script that I can enable to run it as a daemon after a reboot or with the service command.
Because I'm realy not used to write those scripts by myself, is there anyone that can help out? There is no systemd available on alpine linux.
Maybe as a starter that just leads to "blocky crashed":
Beta Was this translation helpful? Give feedback.
All reactions