1

I have this script named startupcss I placed it on /etc/init.d then add the service update-rc.d startupcss defaults but when I try to start the service service startupcss start I get this error startupcss: unrecognized service, obviously does not run on startup also

Here's my startupcss

#! /bin/sh

### BEGIN INIT INFO
# Provides:          startupcss
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

# /etc/init.d/startupcss

case "$1" in
  start)
    screen -A -m -d -S css-beta-server /root/css-server/srcds_run -game cstrike +map de_dust2 +maxplayers 32 -port 27015 -tick 100 
    echo "css server started"
    ;;
  stop)
    screen -S css-beta-server -X quit
    echo "server stopped"
    ;;
  *)
    echo "Usage: /etc/init.d/startupcss {start|stop}"
    exit 1
    ;;
esac

exit 0

how can i fix this ? also I am log in as root

2 Answers 2

0

make sure the script is executable

chmod +x /etc/init.d/startupcss
1
  • oh, goody, it was that simple :)
    – Sverre
    Commented Jul 15, 2014 at 7:04
0

You can simply add your script in:

System Tools -> Preferences -> Startup Applications

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .