Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The program molly-guard is a brilliant little tool which will prompt you for a piece of information before you reboot or shut down a system. Usually it asks for the hostname. So when you work a lot via SSH, you won't end up taking down the wrong server, just because you were in the wrong tab or window.

Now, this works all fine when you say reboot on the command line while you are already root. However, it won't work if you do sudo reboot (i.e. it won't even ask). How can I get it to work with sudo as well?

System: Raspbian (latest, including updates), package molly-guard version 0.4.5-1.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Mollyguard basically works by placing scripts in /usr/sbin/*. These scripts call the actual shutdown/halt/reboot binaries that are stored in /sbin. Sudo or the root on your system is probably set with a PATH that has /sbin before /usr/sbin/ in the effective PATH. Adjust your path so that /usr/sbin/ is first.

share|improve this answer
    
Thanks, I'll give that a try. –  0xC0000022L Oct 30 '13 at 12:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.