remove shutdown messages in console

Cary cary at sdf.org
Sat Feb 8 01:21:49 UTC 2014


Warner Losh wrote:
> 
> On Feb 3, 2014, at 8:26 PM, Julian Elischer wrote:
> 
>> On 2/2/14, 6:07 PM, Reza Mirzazadeh wrote:
>>> hi . how can i remove shutdown messages in console ? or even print my
>>> arbitrary messages in console ?
>>>
>>>
>>> *** FINAL System shutdown message from root at geekiam ***
>>> System going down IMMEDIATELY
>>>
>>> some messages like these ! i don't want it print theses messages
>>> --
>>> _______________________________________________
>>> freebsd-hackers at freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>>>
>> we implimented the consmute sysctl option to "mute" an otherwise configured console for exactly this purpose.
>> (and boot messages).
> 
> Except these are different beast. They aren't kernel messages, but generated by userland...
> 
> to get rid of these, hack /etc/syslog.conf to get rid of the *.emerg * line.
> Or hack shutdown to stop sending them....
> Or use 'halt' and 'reboot' only
> 
> Warner
> 
> 
> 
It was easy to substitute an arbitrary message.

I used the following command:

# sed 's/System going down IMMEDIATELY/Farewell, Doctor F, until our paths meet yet
once more/' /usr/src/sbin/shutdown/shutdown.c >new.shutdown.c

then ran "clang -o shutdown new.shutdown.c" .   If the file "shutdown" were copied to
/sbin would that work as expected?

Cary

-- 
cary at sdf.org
SDF Public Access UNIX System - http://sdf.org


------------------------------


More information about the freebsd-hackers mailing list