<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif">First off, I would say that
there is no need to mount /proc, if its not necessary. For the most
part, job files, wouldn't even require /proc to be mounted. Following
on from that logic, there is only 1 place, that I can see, that
actually attempts to use a /proc file, when upstart changes the oom_adj
value. So, first check to see if the job file is even changing that
value, if not, /proc is not needed and skip that step. Second, if it
does need /proc, then what? You could simply fail the job, quietly
ignore the error, or mount proc? I guess that part is up for debate
yet.<br>
<br>
It should not use system(), it opens itself up for other problems.<br>
<br>
Jeff<br>
</font><br>
Garrett Cooper wrote:
<blockquote
cite="mid:364299f40902231849t30b10318k14f4634e5afaf22d@mail.gmail.com"
type="cite">
<pre wrap="">On Mon, Feb 23, 2009 at 2:14 PM, Adam Sampson <a class="moz-txt-link-rfc2396E" href="mailto:ats@offog.org"><ats@offog.org></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Scott James Remnant <a class="moz-txt-link-rfc2396E" href="mailto:scott@netsplit.com"><scott@netsplit.com></a> writes:
</pre>
<blockquote type="cite">
<pre wrap="">Nobody has supplied a patch.
</pre>
</blockquote>
<pre wrap="">Well, here's what I'm using happily, but I suspect a little more finesse
would be useful. ;)
<a class="moz-txt-link-freetext" href="http://offog.org/darcs/garstow/sys/upstart/files/mountproc.diff">http://offog.org/darcs/garstow/sys/upstart/files/mountproc.diff</a>
</pre>
</blockquote>
<pre wrap=""><!---->
Uh, that will almost certainly fail if it can't allocate a shell
because system(3) calls execve(2) and allocates a shell.
Using mount(2), like so, would be better:
#include <string.h> /* For strerror(3). */
#include <errno.h>
#include <sys/mount.h>
#include <linux/kernel.h> /* For panic(2). */
/* ... */
if (mount("none", "/proc", "proc", 0, NULL) < 0) {
/* Change to OOM support not available, etc for this instead of a panic? */
panic ("Failed to mount /proc: %s\n", strerror(errno));
}
You'll potentially need to do similar for /dev and /dev/console
(we currently do that, but I'm not sure if /dev/console is needed...).
Combined with proper calls to fstab(5) with getent, this should be
solved properly in less than 30 lines.
Cheers,
-Garrett
</pre>
</blockquote>
</body>
<!--[object_id=#panasonic.aero#]--><FONT face=Tahoma>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"><FONT color=#0000ff><FONT size=2></FONT></FONT></FONT><FONT size=1> </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"><FONT color=#0000ff></FONT></FONT><FONT size=1> </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"><FONT color=#0000ff size=1>Disclaimer: The information contained in this transmission, including any</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"><FONT color=#0000ff><FONT size=1>attachments, may contain confidential information of Panasonic Avionics<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"><FONT color=#0000ff><FONT size=1>Corporation.<SPAN style="mso-spacerun: yes"> </SPAN>This transmission is intended only for the use of the <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"><FONT color=#0000ff><FONT size=1>addressee(s) listed above.<SPAN style="mso-spacerun: yes"> </SPAN>Unauthorized review, dissemination or other use <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"><FONT color=#0000ff><FONT size=1>of the information contained in this transmission is strictly prohibited. <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"><FONT color=#0000ff><FONT size=1>If you have received this transmission in error or have reason to believe <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"><FONT color=#0000ff><FONT size=1>you are not authorized to receive it, please notify the sender by return <o:p></o:p></FONT></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#0000ff size=1>email and promptly delete the transmission.</FONT></P>
<P align=left><FONT color=#0000ff size=2></FONT></P></FONT></html>