Mike Carroll <druidlabs@...> writes:

> 
> Wayne Merricks <waynemerricks <at> ...> writes:
> > /var/run/rivendell being deleted is an Ubuntu thing.  They like 
> > deleting everything in /var/run on reboot.
> > 
> > I used to use a really crappy init script I wrote on Ubuntu 11.04, it 
> > should still work.  Change the chown line to your own username.
> >,
[snip]
> ...I don't think that's the problem. I looked at the rivendell script 
> and it checks for and creates the /var/run/rivendell directory before 
> performing either a start or a stop request.

I dug further. As noted, the /etc/init.d/rivendell script will create the 
/var/run/rivendell directory if it's not there.  So if you've got Rivendell 
set to start after a boot (and before you try to run one of the RD* 
programs), then things work OK.

If you don't run the script at boot time, then whenever you run an RD* 
program, under the covers Rivendell starts the daemons. However, the routine 
that's involved doesn't create the directory if it's missing.

So the "official" answer might be to always run the Rivendell script before 
accessing the RD* modules.

Or you can hack the RDWritePid routine in the rdconf.cpp source file in the 
/lib directory of the Rivendell source tree, so it creates the directory if 
it's not there. Insert this block of code following the Qstring line towards 
the start of the function:


  struct stat st = {0};
  if (stat((const char *)dirname, &st) == -1) {
     prev_mask = umask(0000);
     mkdir((const char *)dirname, 0755);  // matches /etc/init.d/rivendell 
result
     umask(prev_mask);
     chown((const char *)dirname, owner, group);  // doesn't match rivendell 
result
  }


As the comment says, the owner/group of the directory doesn't match how the 
rivendell script works.  It doesn't seem to matter, but for sure I wouldn't 
run this change in a production system.


_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to