<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi James<div><br></div><div>Thanks very much for the reply :)</div><div><br></div><div>I had added the full path to exec as well but had not updated that when posting (oops)</div><div><br></div><div>Your solution to remove the variable and use the substitution has worked but looks untidy in comparison.</div><div>Is there no real way to pass variables to other parts of the script?</div><div><br></div><div>I assume, based on script now working, that the script / end script stanzas treat all variables as local hence not available</div><div>outside. Is there an option to maybe have a global variable for a particular script that could be set inside one stanza and used</div><div>either in another or the exec line as in my example?</div><div><br></div><div>Thanks again for the assist</div><div><br></div><div>cheers</div><div>grail<br><br>> Date: Wed, 23 Mar 2011 09:12:10 +0000<br>> From: james.hunt@canonical.com<br>> To: upstart-devel@lists.ubuntu.com<br>> Subject: Re: rsyslog script<br>> <br>> -----BEGIN PGP SIGNED MESSAGE-----<br>> Hash: SHA1<br>> <br>> On 23/03/11 01:20, Grail Dane wrote:<br>> > In case anyone can see room to point me in the right direction here, I<br>> > have recorded my latest bootup<br>> > messages and the one for my rsyslog looks like:<br>> > <br>> > init: rsyslog main process (860) terminated with status 1<br>> > init: rsyslog main process ended, respawning<br>> > <br>> > As you can see it seems to respawn but without an associated PID yet<br>> > running initctl list the corresponding entry is:<br>> > <br>> > rsyslog start/running<br>> > <br>> > Whereas all others with a PID also have - , process PID<br>> > And even though it says running, a ps yields nothing and no logs are<br>> > getting updated.<br>> > <br>> > Any thoughts or help would be appreciated :)<br>> > grail<br>> > <br>> > ------------------------------------------------------------------------<br>> > From: grail69@hotmail.com<br>> > To: upstart-devel@lists.ubuntu.com<br>> > Subject: rsyslog script<br>> > Date: Tue, 1 Mar 2011 03:23:15 +0000<br>> > <br>> > I seem to be stuck with this one and not sure if possible to do what I<br>> > am trying?<br>> > <br>> > I copied the rsyslog.conf from my Ubuntu machine and changed it to the<br>> > below:<br>> > <br>> > < ---------- start -----------------><br>> > # rsyslog - system logging daemon<br>> > #<br>> > # rsyslog is an enhanced multi-threaded replacement for the traditional<br>> > # syslog daemon, logging messages from applications<br>> > <br>> > description"system logging daemon"<br>> > <br>> > start on filesystem<br>> > stop on runlevel [06]<br>> > <br>> > expect fork<br>> > respawn<br>> > <br>> > pre-start script<br>> > COMPAT=$(/sbin/rsyslogd -v | awk 'NR == 1{print substr($2, 1, 1)}')<br>> > end script<br>> > <br>> > exec rsyslogd -c$COMPAT<br>> > < ---------- end -----------------><br>> > <br>> > This seems to start and assign a PID, it then terminates and respawns<br>> > but without a PID and consequently is not really running.<br>> > <br>> > So i guess my question is: Am I not able to use variables in this way or<br>> > have I done it the wrong way?<br>> > If yes to the wrong way, would someone please educate me?<br>> > <br>> > Also I am guessing this is not really a devel question ... is there a<br>> > support list?<br>> > <br>> > Cheers<br>> > grail<br>> > <br>> > -- upstart-devel mailing list upstart-devel@lists.ubuntu.com Modify<br>> > settings or unsubscribe at:<br>> > https://lists.ubuntu.com/mailman/listinfo/upstart-devel<br>> > <br>> Hi Grail,<br>> <br>> The problem with your script is that the "COMPAT" variable is not<br>> "visible" to the exec stanza: Upstart runs each script section in a<br>> separate process. Therefore I think that your exec is actually running<br>> "rsyslogd -c" (which is invalid).<br>> <br>> As to a solution: you don't actually need that pre-start. You could just<br>> do this:<br>> <br>> exec rsyslogd -c$(/sbin/rsyslogd -v | awk 'NR == 1{print substr($2, 1, 1)}')<br>> <br>> One other comment: you have specified the path to rsyslogd in your<br>> pre-start, but not in your exec stanza. I appreciate that the original<br>> .conf file has the same problem, but it is always best to specify the<br>> path to avoid surprises :)<br>> <br>> Finally, be careful with respawn and script sections (see<br>> https://bugs.launchpad.net/upstart/+bug/406397).<br>> <br>> Regards,<br>> <br>> James.<br>> - --<br>> James Hunt<br>> ____________________________________<br>> Ubuntu Foundations Team, Canonical.<br>> -----BEGIN PGP SIGNATURE-----<br>> Version: GnuPG v1.4.10 (GNU/Linux)<br>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/<br>> <br>> iEYEARECAAYFAk2JuWYACgkQYBWEaHcQG9eJggCghk1CNnnMRv7jH4D9L1C8A7CH<br>> mKsAn2Zx50abeR4yWqwMT2Bx5mHdMdTY<br>> =8U0r<br>> -----END PGP SIGNATURE-----<br>> <br>> -- <br>> upstart-devel mailing list<br>> upstart-devel@lists.ubuntu.com<br>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/upstart-devel<br></div> </body>
</html>