[torquedev] enablemomrestart with pbs_mom symlinks

Craig West cwest at astro.umass.edu
Tue Jul 8 13:05:21 MDT 2008


I've already been through the code myself and I found the section you 
are referring to. I wasn't actually thinking of changing that section. 
If we followed the original idea of allowing an admin to change the path 
to the mom executable via momctl, then all we really need to change is 
the runtime variable "MOMExePath" in src/resmom/mom_main.c . The next 
time it checks the mtime of the exec it should be different, and pbs_mom 
will restart as required.

After thinking about it I realised that the MOMExePath should point to 
the actual executable and not a symlink. Otherwise what is there to say 
that the symlink won't change, but the executable will. This would be 
missed if you were only looking at the symlink. Remotely changing the 
MOMExePath makes sense to me.
However, the problem with changing the MOMExePath might be a security 
issue, pbs_mom is usually/often run as root (as I understand it), and 
changing this variable would allow any file to be executed (as root). It 
seems only root can run momctl, but is there something stopping this 
restriction from being removed? Perhaps an option could be added to 
mom_priv/config which would enable MOMExePath to be changed remotely, 
and by default it is disabled?

I have a patch that allows the changing the MOMExePath remotely (without 
the pbs_mom config option mentioned above). It works correctly under my 
testing with Linux x86_64. I can make it available.


On 07/07/2008 11:48 PM, Chris Samuel wrote:
> Hi Craig!
> ----- "Craig West" <cwest at astro.umass.edu> wrote
>> I've just been through the process of updating my nodes to 2.3.1 (from
>> 2.3.0). During the process I attempted to use the enablemomrestart,
>> but without success. I think the problem is that the pbs_mom is not
>> looking at the symlink, but rather directly at the executable.
> Yup, that's quite correct, I've stumbled across this in
> the past but just restarted pbs_mom by hand across the
> cluster.
> The issue is that (on Linux) pbs_mom defaults to using
> the content of /proc/self/exe as the path to the executable,
> but that's been dereferenced to the actual path which won't
> get changed.
> This is defined in MOMFindMyExe() in src/resmom/mom_main.c,
> but I'm not sure if commenting that check out will help as
> the rest of the code is a little hard to follow..
> cheers,
> Chris

More information about the torquedev mailing list