Centos5 NUT 2.6.5, compiled from source I was reminded by a previous thread about a message I get when starting NUT... Starting upsd: fopen /var/run/nut/upsd.pid: No such file or directory Starting upsmon: kill: No such process upsd removes its pid files when it's stopped, upsmon does not. If I remove upsmon's manually after stopping it, I get a different message for it when I start it back up... fopen /var/run/nut/upsmon.pid: No such file or directory I can see the fopen errors happening because of the pre-existing process check. But for the first upsmon case, what is it trying to "kill"? If this is normal operation, maybe they shouldn't be printed to the console?
On Jul 30, 2013, at 1:36 PM, Kris Jordan wrote:> upsd removes its pid files when it's stopped, upsmon does not.Hmm, interesting observation. Offhand, I think both should remove the PID files, but the way that upsmon drops root privileges might make this difficult.> If I remove upsmon's manually after stopping it, I get a different message for it when I start it back up... > > fopen /var/run/nut/upsmon.pid: No such file or directory > > I can see the fopen errors happening because of the pre-existing process check. But for the first upsmon case, what is it trying to "kill"?When you say the "first" upsmon case, do you mean this line? https://github.com/networkupstools/nut/blob/master/clients/upsmon.c#L1923> If this is normal operation, maybe they shouldn't be printed to the console?Agreed. It would probably involve adding another parameter to the sendsignal() calls, indicating whether the kill() function call is expected to fail or not. Patches welcome :-) -- Charles Lepple clepple at gmail
Charles Lepple wrote, On 7/31/2013 6:04 AM:> On Jul 30, 2013, at 1:36 PM, Kris Jordan wrote: > >> upsd removes its pid files when it's stopped, upsmon does not. > Hmm, interesting observation. Offhand, I think both should remove the PID files, but the way that upsmon drops root privileges might make this difficult.Makes sense. The manual says, --with-pidpath=PATH Changes the directory where pid files are stored. By default this is /var/run. Certain programs like upsmon will leave files here.>> If I remove upsmon's manually after stopping it, I get a different message for it when I start it back up... >> >> fopen /var/run/nut/upsmon.pid: No such file or directory >> >> I can see the fopen errors happening because of the pre-existing process check. But for the first upsmon case, what is it trying to "kill"? > When you say the "first" upsmon case, do you mean this line? > > https://github.com/networkupstools/nut/blob/master/clients/upsmon.c#L1923The kill error is coming from this line: https://github.com/networkupstools/nut/blob/master/common/common.c#L263 Which is called from: https://github.com/networkupstools/nut/blob/master/client/upsmon.c#L1930 In which case would you need to "see if this is going to work first"?> >> If this is normal operation, maybe they shouldn't be printed to the console? > > Agreed. It would probably involve adding another parameter to the sendsignal() calls, indicating whether the kill() function call is expected to fail or not. Patches welcome :-)I'll see what I can do.