Thread View: news.software.nntp
3 messages
3 total messages
Started by Daniel Guntli
Thu, 28 Sep 2006 21:37
Starting INN automatically on Mac os x
Author: Daniel Guntli
Date: Thu, 28 Sep 2006 21:37
Date: Thu, 28 Sep 2006 21:37
11 lines
1401 bytes
1401 bytes
Hello I'd like to have starting my INN newsserver at each system startup autmatically on my mac. The command is: sudo su - news -c /usr/local/news/bin/rc.news How to have it executed automatically at each startup?? Thanx, Daniel
Re: Starting INN automatically on Mac os x
Author: Jeffrey M. Vinocur
Date: Thu, 28 Sep 2006 22:35
Date: Thu, 28 Sep 2006 22:35
17 lines
1574 bytes
1574 bytes
In article <C1420D49.416E%swissmininature@bluewin.ch>, Daniel Guntli <swissmininature@bluewin.ch> wrote: > >I'd like to have starting my INN newsserver at each system startup >autmatically on my mac. This is actually a Mac OS X question, and not an INN question... it would be the same for any unix command you wanted to run on Mac OS X startup. I suspect you can find a number of relevant websites with a quick google search. Try "os x unix startup" as a query, for example. -- Jeffrey M. Vinocur jeff@litech.org
Re: Starting INN automatically on Mac os x
Author: Bill Cole
Date: Fri, 29 Sep 2006 14:08
Date: Fri, 29 Sep 2006 14:08
95 lines
4438 bytes
4438 bytes
In article <C1420D49.416E%swissmininature@bluewin.ch>,
Daniel Guntli <swissmininature@bluewin.ch> wrote:
> Hello
>
> I'd like to have starting my INN newsserver at each system startup
> autmatically on my mac. The command is:
>
> sudo su - news -c /usr/local/news/bin/rc.news
>
> How to have it executed automatically at each startup??
It depends to some degree on which version of MacOS X you are running,
since 10.4 (Tiger) introduced a new startup system (launchd) that is
unlike anything else anywhere. In principle, launchd is the way to start
up a daemon of any sort under Tiger, but in practice it is broken
because your startup script has to manage all of its own dependencies
like storage and networking initialization. If you use launchd, you need
to rewrite rc.news to fit your circumstances and the rather different
environment of running on MacOS X under launchd. That would be a good
thing for someone to do and perhaps to contribute to the INN project,
but it is not really necessary if "working" is all you need.
What I do instead is to use the older 'SystemStarter' subsystem (which
still works in Tiger) which still requires me to check for spool disks
if they are automounted, but at least I can be certain that the INN
startup is running at a point where those disks can be easily mounted
and I have all of my network interfaces configured, because
SystemStarter supports explicit dependencies. The best docs I've seen
for a SystemStarter "StartupItem" are at
http://www.afp548.com/article.php?story=20041018090215552 and
http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartu
p/index.html
The missing bit in those is the actual code to start a specific daemon,
obviously. My /Library/StartupItems/INN/INN looks like this:
#!/bin/sh
. /etc/rc.common
if [ ${1:-noset} == "stop" ] || [ ${1:-noset} == "restart" ]; then
ConsoleMessage "Stopping INN"
su - news -c 'rc.news stop'
fi
if [ ${1:-noset} == "start" ] || [ ${1:-noset} == "restart" ]; then
ConsoleMessage "Starting INN"
STORAGE=`grep -v "^#" ~news/etc/*|grep Volumes|
sed 's#.*/Volumes/\([^/ ]*\).*#\1#'|sort -u`
for DISK in $STORAGE
do
/usr/sbin/disktool -l | grep $DISK |
sed "s/.*'\(disk[0-9]*s[0-9]*\)'.*/\1/" |
xargs /usr/sbin/diskutil mount
done
su - news -c 'rc.news start'
fi
And StartupParameters.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>INN News Server</string>
<key>Messages</key>
<dict>
<key>restart</key>
<string>Restarting INN News server</string>
<key>start</key>
<string>Starting INN News server</string>
<key>stop</key>
<string>Stopping INN News server</string>
</dict>
<key>OrderPreference</key>
<string>Last</string>
<key>Provides</key>
<array>
<string>News</string>
</array>
<key>Requires</key>
<array>
<string>Resolver</string>
<string>Disks</string>
</array>
</dict>
</plist>
--
Now where did I hide that website...
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads