sexta-feira, 11 de agosto de 2017

/etc/rc.local no Debian Stretch

No Debian recente "Stretch", vem sem o arquivo "/etc/rc.local", muito útil para inicialização de scripts, quando o computador é ligado.

Para criar o arquivo:

# cd /etc/
# ls
# touch rc.local
# chmod +x rc.local

# vim rc.local

Inserir:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.


/root/firewall_testpc.sh
#seuscrips.sh

exit 0
EOF

Depois:

# systemctl start rc.local

# systemctl status rc.local