I'm using apache2 and postgres running on Ubuntu Server 10.04.I have removed the startup scripts for both of these apps and I'm using supervisor to monitor and control them. The problem I have run into is that both of these need directories in /var/run (with the correct permissions for the users they run under) for pid files. How do I create these during startup as they need to be created as root and then chown'd to the correct user?EditIt seems the best way to so this is to creat the directories with custom init scripts. As I have no shell scripting skills at all how do I go about this?
Create directory in /var/run/ at startup
ubuntu;permissions;init script
In reply to this comment:There are currently no startup scripts  for the servcies. The supervisor  daemon is started by the init.d  scripts and then the other services  are started by this service, which  should not run as root.If your supervisor is started from init.d script, then just create another init.d script with the preferences to be run before the supervisor starts ( how you achieve this is totally dependent on your flavor of **IX ).In its start method create needed directories with required permissions.In its stop method tear those directories down.