Re: Unslung init scripts - making your own
- Thanks Marcel - don't know how I missed the 'shebang' (#!/bin/sh) at
the start. I should have also looked at the other init scripts in
/opt/etc/init.d/, which would have shown me this. Sadly, I don't write
many shell scripts these days, so this may be why I'd forgotten this
was a good way to start them :-)
I'll look again at the other init scripts for more good ideas, and
post the revised ones for LCDd and lcdproc here when they're ready.
Thanks again for your help - BTW, I'm expecting the Pertelian display
to arrive tomorrow, so I should be able to report back here on
progress in a couple of days.
--- In firstname.lastname@example.org, Marcel Nijenhof <nslu2@...> wrote:
> On Wed, 2006-12-27 at 23:13 +0000, Tim Walker wrote:
> > NAME=LCDd DAEMON=/opt/sbin/LCDd PIDFILE=/opt/var/run/$NAME.pid
> > if [ -n "`pidof $NAME`" ] ; then
> > echo "Stopping $NAME:"
> > killall $NAME
> > else
> > echo "Starting $NAME:"
> > $DAEMON &
> > fi
> > ....
> > - Can anyone spot any potential problems with the scripts themselves?
> > (I know the binaries' locations are correct, but I may be missing
> > something else for all I know.)
> 1) I would at #!/bin/sh on the first line.
> 2) I am not sure if your daemon writes to stdout or stderr.
> In that case everything is written to a serial line which in
> most cases isn't connected at all. Maybe that output should
> be saved somewhere.
- Hi Rod,
Happy New Year to you (and to everyone else here)... just getting back
into normal routine after Christmas :-)
--- In email@example.com, "Rod Whitby" <rod@...> wrote:
> Would you like to become an Optware developer so you can commit your
additions to the repository?
> Your scripts look fine, and your assumption about the numbers is
> -- Rod
Thanks for your (and Marcel's) feedback on the scripts - I'm going to
adjust them a bit, and post the updated ones here in due course. I'd
be happy to help further if I can - Unslung is a great project, and
I'dlike to give something back to the community in return for giving
me a whole new network server...
I'm expecting delivery of the Pertelian display any day now (hopefully
tomorrow, Jan 2nd), so would it be OK with you if I make sure I can
get it working, then come back here and let you all know how (if?) it
worked? If all is well, I'd be glad to try packaging up lcdproc for
Unslung, if it's something I'd be able to do.
Only thing is, I'm not really a programmer-sort of developer - I'm
fairly comfortable with the basics of compiling an application from
source (including some config options), but have never written
anything more than a few bash and PHP scripts, and haven't used SVN or
systems like that. Having said that, if creating packages isn't that
difficult, I'm happy to give it a go, at least for lcdproc.
Is this the wiki entry on creating Optware packages?
(BTW: I compiled v0.5.0 of lcdproc - the latest is v0.5.1 - as it
looks from the changelog as if the HD44780/lcdserializer driver which
the Pertelian display needs, has been removed from 0.5.1. I'll see if
this one works for me, and go from there.)
> -----Original Message-----
> From: "Tim Walker" <tawalker2@...>
> Date: Thursday, Dec 28, 2006 9:43 am
> Subject: [nslu2-linux] Unslung init scripts - making your own
> I've started compiling the occasional application on Unslung, and was
> wondering how to write my own init scripts to go in /opt/etc/init.d/
- i.e. the ones which are named something like 'S80thttpd'. (I'm
> specifically interested in making two scripts for LCDd/lcdproc - see
> my earlier post
> (http://tech.groups.yahoo.com/group/nslu2-linux/message/16714) for
the background to this.)
> Adapted from the Fuppes HOWTO, here are the two scripts I've made so
> NAME=LCDd DAEMON=/opt/sbin/LCDd PIDFILE=/opt/var/run/$NAME.pid
> if [ -n "`pidof $NAME`" ] ; then
> echo "Stopping $NAME:"
> killall $NAME
> echo "Starting $NAME:"
> $DAEMON &
> [as above, but with 'lcdproc' replacing 'LCDd', and the daemon is in
> There are two questions which are on my mind at this stage:
> - I named the scripts on the assumption that the 'S number' in the
> name affects the order in which the scripts are executed. Am I
> correct, and if so, would anyone suggest more appropriate numbers,
in case LCDd and lcdproc need to be running before/after anything else?
> - Can anyone spot any potential problems with the scripts themselves?
> (I know the binaries' locations are correct, but I may be missing
> something else for all I know.)
> Many thanks in advance for any suggestions on the above, or indeed
my earlier post if anyone has something to add. Anything I learn from
the above will go into the HOWTO I hope to produce for installing a
> Pertelian X2040 LCD display on Unslung (my earlier post would form
the first part). I've just ordered the Pertelian today, so when I have
it I hope to update you on how I get on with adding it to my slug (if
it ends up possible at all on Unslung, naturally).
> Happy New Year to everyone on the list!
> Best regards,
> Yahoo! Groups Links
- Tim Walker wrote:
> Only thing is, I'm not really a programmer-sort of developer - I'mYes, and you don't need much more than the skills you already have to
> fairly comfortable with the basics of compiling an application from
> source (including some config options), but have never written
> anything more than a few bash and PHP scripts, and haven't used SVN or
> systems like that. Having said that, if creating packages isn't that
> difficult, I'm happy to give it a go, at least for lcdproc.
> Is this the wiki entry on creating Optware packages?
contribute a package.