[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.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
howtos:slackware_admin:service [2019/02/21 09:47 (UTC)] – use USER/GROUP markandhowtos:slackware_admin:service [2019/02/21 10:16 (UTC)] – add exit 1 markand
Line 29: Line 29:
   * **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 139: Line 141:
   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 "$PRGNAM is already running: $(cat $PID)"     echo "$PRGNAM is already running: $(cat $PID)"
-  elif [ -x $BIN ]; then+    exit 1 
 +  fi 
 +   
 +  if [ -x $BIN ]; then
     echo "Starting $PRGNAM: $BIN $ARGS"     echo "Starting $PRGNAM: $BIN $ARGS"
   fi   fi
 howtos:slackware_admin:service ()