Esta receta muestra como empaquetar scripts de inicio en un sistema debian.
para generar el directorio basePor supuesto deben ser ejecutables (chmod +x y #!/bin/bash).
Template: script/IdPregunta Type: string Default: respuesta por defecto Description: Is this the ask?: Description-es.UTF-8: Esta es la pregunta?
#!/bin/bash set -e # if we do not have debconf, we just skip this . /usr/share/debconf/confmodule || exit 0 db_version 0.1 db_capb db_title glacier2node db_input high scriptName/question0 || true ......... db_go || true
#!/bin/bash set -e . /usr/share/debconf/confmodule || exit 0 db_get scriptName/question0 q0="$RET"
### BEGIN INIT INFO # Provides: nombre del paquete # Required-Start: $syslog # Required-Stop: $syslog # Should-Start: $local_fs # Should-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: script de prueba # Description: pues eso ### END INIT INFO
case "$1" in start) start_script ;; stop) stop_script ;; restart) stop_script start_script ;; force-reload) reload_script ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart}" >&2 exit 2 ;; esac exit 0
changelog copyright files myScript.init postrm rules compat control docs preinst postinst prerm
y si utilizamos debconf también deben estar los archivos config y templates. Ahora solo queda:
dpkg-buildpackage -us -uc -rfakeroot