Debian and LSBInitScripts
Since Debian 6.0 the command insserv is introduced and used by update-rc.d (so you don't have to use it instead). But a LSB (abbr. Linux Standard Base) header is now "needed" in the init script. You can use system facility names to decide when your script should start and stop, or even define your own. But often it's good enough to just make sure it starts after everything else. For that you can use the
$all
argument
that's supported by insserv. In my script I don't require anything to stop it, so I leave it empty which is
also supported.#!/bin/sh ### BEGIN INIT INFO # Provides: scriptname # Required-Start: $all # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Mounts Intrashare at DJ-SERVER-W1. ### END INIT INFO mount -t cifs -o username=x,password=x,uid=1001,gid=1001 //0.0.0.0/Share /Intrashare
Install with (optional) insserv scriptname (Use -n param to preview changes).
Usage: insserv [<options>] [init_script|init_directory] Available options: -h, --help This help. -r, --remove Remove the listed scripts from all runlevels. -f, --force Ignore if a required service is missed. -v, --verbose Provide information on what is being done. -p <path>, --path <path> Path to replace /etc/init.d. -o <path>, --override <path> Path to replace /etc/insserv/overrides. -c <config>, --config <config> Path to config file. -n, --dryrun Do not change the system, only talk about it. -s, --showall Output runlevel and sequence information. -d, --default Use default runlevels a defined in the scripts
Or just use update-rc.d as usual.
More Info:
LSBInitScripts
LSBInitScripts/DependencyBasedBoot
LSBInitScripts/StatusSupport