Upstart trunk code needs /proc to be mounted
Garrett Cooper
yanegomi at gmail.com
Fri Jul 25 01:06:07 BST 2008
On Thu, Jul 24, 2008 at 10:59 AM, Sandeep Puddupakkam (spuddupa)
<spuddupa at cisco.com> wrote:
> Hi,
> I am trying to compile and use upstart from trunk. I was trying to start
> a job (first job) and I ran into some error that was causing upstart to
> restart a few time and then core dump.
> Upon investigation, I found that the code inside job_process.c function
> job_process_spawn() was trying to access /proc which is not mounted at
> this time.
>
> /* Adjust the process OOM killer priority.
> */
> snprintf (filename, sizeof (filename), "/proc/%d/oom_adj",
> getpid ());
> fd = fopen (filename, "w");
> if (! fd) {
> nih_error_raise_system ();
> job_process_error_abort (fds[1],
> JOB_PROCESS_ERROR_OOM_ADJ, 0);
> }
> fprintf (fd, "%d\n", class->oom_adj);
> if (fclose (fd)) {
> nih_error_raise_system ();
> job_process_error_abort (fds[1],
> JOB_PROCESS_ERROR_OOM_ADJ, 0);
> }
>
> The /proc directory gets mounted as part of executing rc.sysinit on our
> system.
> The workaround that I used was to mount the /proc directory within the
> upstart code in main().
> Is it required that /proc be present when upstart is started?
> What would happen if the above code is commented? Is/will the oom_adj
> file read and used later on?
>
> Thanks,
> Sandeep
Shucks. It doesn't look like there's a sysctl that can be queried for
this info...
Is there another means to access /proc data (other than by /proc)?
Thanks,
-Garrett
More information about the upstart-devel
mailing list