I was reading the shutdown man page and I noticed this paragraph:
I’ve always been interested about this part, because in the past I have worked with routers based on Linux where there was a reboot or a shutdown script that would allow you to enter the reason why you’re doing the shutdown and that would be logged.
is there a native or out of the box way to do this with the poweroff command? or the only way I have is to create a script that will prompt for a user input and then log it into Messages.log and then run the shutdown command ?
Code:
At shutdown time a message is written to the system log, containing the
time of shutdown, the person who initiated the shutdown and the reason.
I’ve always been interested about this part, because in the past I have worked with routers based on Linux where there was a reboot or a shutdown script that would allow you to enter the reason why you’re doing the shutdown and that would be logged.
is there a native or out of the box way to do this with the poweroff command? or the only way I have is to create a script that will prompt for a user input and then log it into Messages.log and then run the shutdown command ?