1

My objective is to start a personal daemon called gobatch. gobatch is stored into /usr/sbin/gobatch (during gobatch is just an infinite loop).

When I use /etc/init.d/gobatch start I got this error:

janv. 08 14:39:03 ubuntu systemd[1]: Failed to start SYSV: ChilliSpot is an open source captive portal.

/usr/sbin/gobatch

#! /bin/bash

while true;
do

done

/etc/init.d/gobatch:

#!/bin/sh
#### BEGIN INIT INFO 
# Provides:          chillispot et freeradius dans le chroot 
# Required-Start:    $local_fs $network 
# Required-Stop:     $local_fs $remote_fs _
# Default-Start:     2 3 4 5 
# Default-Stop:      0 1 6 
# Short-Description: Wireless & LAN Access Point Controller 
# Description:       ChilliSpot is an open source captive portal 
#                    or wireless LAN access point controller. 
### END INIT INFO 


PATH=/bin:/usr/bin:/sbin:/usr/sbin 
DESC="Deamon that allows you to run cyclicaly at a date or a specific time a program" 
NAME=gobatch 
DEAMON=/usr/sbin/gobatch 
PIDFILE=/var/run/$NAME.pid 
SCRIPTNAME=/etc/init.d/"$NAME" 

. /lib/lsb/init-functions 

case "$1" in 
start) log_daemon_msg "Starting gobatch" 
       start_daemon -p $PIDFILE $DAEMON 
       log_end_msg $? 
       ;; 
stop) log_daemon_msg "Stopping gobatch" 
      killproc -p $PIDFILE $DAEMON 
      RETVAL=$? 
      [ $RETVAL -eq 0 ] && [ -e "$PIDFILE" ] && rm -f $PIDFILE 
      log_end_msg $RETVAL 
      ;; 
restart) log_daemon_msg "Restarting gobatch" 
         $0 stop 
         $0 start 
         ;; 
esac 
exit 0

Can you help me to fix this problem?

Thank's a lot!

Royce
  • 1,557
  • 5
  • 19
  • 44
  • https://askubuntu.com/questions/993552/service-starting-failed-failed-to-start-sysv – M. Becerra Jan 08 '18 at 17:41
  • Post two questions is a problem? If it is I can delete one. – Royce Jan 08 '18 at 17:44
  • https://superuser.com/questions/907973/failed-to-start-sysv-when-starting-self-made-service – Cedric Jan 08 '18 at 19:46
  • Why are you using `sysv` style init script, why not use `systemd` and write your service script. – iamauser Jan 08 '18 at 20:49
  • Because I follewed a tuto and the author use `sysv` I guess. I don't know what is `systemd`. My script must be a daemon, with `systemd` it is possible? – Royce Jan 08 '18 at 20:55

0 Answers0