Roberto Martelli
2013-Dec-02 19:52 UTC
[Nut-upsuser] upsmon error: Unable to call shutdown command
Il 02/12/2013 14:44, Charles Lepple ha scritto:> On Dec 1, 2013, at 8:46 AM, Roberto Martelli wrote: > >>> If you call "/usr/sbin/pm-hibernate" from the command line, does it >>> execute correctly? >>> >>> Roger >> >> Obviously. > You would be surprised how many times people forget things like #! or the execute bit in their shell scripts... > >> Also thi command doesn't works with upsmon (but works from command line): >> >> /usr/sbin/hibernate > That is odd. > > We aren't doing anything special to execute the command, just a system(2) call: > > https://github.com/networkupstools/nut/blob/v2.7.1/clients/upsmon.c#L1683 > > I'll admit that there could be better error reporting. I added an issue on GitHub, but if you built from source, you can extend the upslogx() command line to see why system() is failing. > >You are right, nothing is obvious, especially in this context. I will try to do what you say (I hope to find some help in some documentation file). It seems only shutdown command works. Nor scripts neither other commands are executed. With NUT version 2.6.3 (not autocompiled but from Ubuntu 12.04 repositories) instead all works fine. Therefore I think this problem is not related to AppArmor or Selinux.