i'm running a centos server and I would like to make it so, that when you type the shut down command(s) it would instead reboot the server.
1 Answer
You could just alias
all shutdown commands to /sbin/reboot
in the system-wide bashrc (/etc/bash.bashrc
) as a hack. This means that running shutdown would instead run the reboot command, but most command-line arguments wouldn't work because reboot
doesn't use the same flags. Also this would only affect users using bash
for their shell, as people using other shells would not respect the system-wide bashrc.
-
thanks for the help, but i noticed that it still executes the shutdown command if i do sudo shutdown Commented Mar 6, 2016 at 15:12
/sbin/shutdown
)