Page 1 of 1

OS X Daemon Programs

Posted: Thu Apr 01, 2010 5:35 pm
by SirWobbyTheFirst
Hello Everyone.

I have finally made the jump to Mac OS X the other day and I'm now the proud owner of an iMac running Snow Leopard. I started working on porting my applications to OS X and wondered how I would create a OS X like service (Or daemon to be precise) because Revolution is a GUI based app and the daemons for OS X or started before the GUI starts and so I was wondering how I would be able to do it with the GUI inactive or the user booted into Single User Mode.

I read in the Read Me file about a special Darwin engine which would enable me to compile rev based console applications, would this do the trick? It seems pretty old as the Read Me stated it was version 2.1.2.

Any help would be most appreciated cos I'm completely clueless having no experience with OS X at all.

Re: OS X Daemon Programs

Posted: Thu Apr 01, 2010 5:46 pm
by BvG
To use the command line version of rev, you need a version before 4.0. If you have bought 4.0 you can ask support so that they give you 3.5.

A command line script is used the same way as a cgi, and almost all the relevant caveats apply.

You say you're clueless about os x. So be assured that starting a deamon in os x is _not_ appreciated by either mac users not the system itself. If the goal is simply a faceless app that starts on startup, look at the "account" system settings for "Login items", set your app there and check the "hide" mark.

Re: OS X Daemon Programs

Posted: Thu Apr 01, 2010 5:48 pm
by SirWobbyTheFirst
Hmm. So would this have the same effect as a Windows Service and it won't be terminated at logoff? If so then would I be able to keep by current version of 4.0?

Thanks for the quick response as well BvG :)

Re: OS X Daemon Programs

Posted: Thu Apr 01, 2010 6:11 pm
by BvG
No, in windows a "login item" would be more like something in the "startup" folder in the windows menu. So a logout will quit all those apps.

Re: OS X Daemon Programs

Posted: Thu Apr 01, 2010 6:13 pm
by SirWobbyTheFirst
Oh right. Bummer. :-/

Oh well thanks anyway BvG I appreciate the help. :)

Re: OS X Daemon Programs

Posted: Thu Apr 01, 2010 6:38 pm
by FourthWorld

Re: OS X Daemon Programs

Posted: Thu Apr 01, 2010 7:02 pm
by SirWobbyTheFirst
Thanks alot FourthWorld. I've bookmarked the page and will take a look at it later.

Re: OS X Daemon Programs

Posted: Fri Apr 02, 2010 1:05 am
by mwieder
It's somewhat true that you need the 3.5 engine. I've made faceless standalone apps for all three supported platforms (Windows, OSX, linux) that take commandline arguments, do their thing, and exit. You don't need to be running in a cgi mode for this, you just need to process the commandline arguments at startup. If you want to process revTalk script files then you do need the cgi mode, and at the moment you need the 3.5 engine for that.

I've also written a login-level app for OSX that installs itself once, asking for sudo password access, then just runs on startup each time (it installs a desktop background from the Astronomy Site of the Day website). It's a login app, not a daemon - I haven't had the need to try making a daemon yet, but from a technical level I don't see why it couldn't be done.