[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howtos:slackware_admin:service [2019/02/21 09:46 (UTC)] – created markand | howtos:slackware_admin:service [2019/02/21 13:22 (UTC)] (current) – markand | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <note warning> | ||
+ | |||
Slackware uses a simple BSD style init script system. | Slackware uses a simple BSD style init script system. | ||
Following the Slackware philosophy, init scripts are quite simple and do not perform any kind of black magic. For example, there are no dependencies between init scripts or monitoring. | Following the Slackware philosophy, init scripts are quite simple and do not perform any kind of black magic. For example, there are no dependencies between init scripts or monitoring. | ||
- | In this section we will cover the creation of a usual script. Please follow the template as much as possible, we do like consistency. | + | In this section we will cover the creation of a usual script. Please follow the template as much as possible |
====== Style ====== | ====== Style ====== | ||
Line 29: | Line 31: | ||
* **reload** (optional): do some reload if applicable, | * **reload** (optional): do some reload if applicable, | ||
* **status** (optional): check wether the service is running. | * **status** (optional): check wether the service is running. | ||
+ | |||
+ | Return 1 from the service file if you were unable to perform the operation requested. | ||
====== Message formats ====== | ====== Message formats ====== | ||
Line 132: | Line 136: | ||
BIN=/ | BIN=/ | ||
CONF=/ | CONF=/ | ||
- | ARGS=-c $CONF | + | ARGS=-c $CONF -u $USER -g $GROUP |
PID=/ | PID=/ | ||
Line 139: | Line 143: | ||
if [ ! -r $CONF ]; then | if [ ! -r $CONF ]; then | ||
echo "No configuration file available. Aborting" | echo "No configuration file available. Aborting" | ||
- | elif [ -s $PID; then | + | exit 1 |
+ | fi | ||
+ | |||
+ | if [ -s $PID ]; then | ||
echo " | echo " | ||
- | elif [ -x $BIN ]; then | + | exit 1 |
+ | fi | ||
+ | |||
+ | if [ -x $BIN ]; then | ||
echo " | echo " | ||
fi | fi | ||
Line 183: | Line 193: | ||
;; | ;; | ||
*) | *) | ||
- | echo "usage: $0 {restart|start|status|stop}" | + | echo "Usage: $0 {restart|start|status|stop}" |
;; | ;; | ||
esac | esac |