Hi Ceriel,
From the command line
$ sudo /usr/local/virtuoso-opensource/bin/virtuoso-t -c virtuoso.ini
-f
and
$ sudo /usr/local/virtuoso-opensource/bin/virtuoso-t -c virtuoso.ini -
f -w
start without errors (within /usr/local/virtuoso-opensource/var/lib/
virtuoso/db/).
Starting as a daemon by launchd virtuoso doesn't succeed.
This is in the .plist:
<array>
<string>/usr/local/virtuoso-opensource/bin/virtuoso-t</string>
<string>-c</string>
<string>virtuoso.ini</string>
<string>-w</string>
</array>
<key>WorkingDirectory</key>
<string>/usr/local/virtuoso-opensource/var/lib/virtuoso/db/</string>
I don't see a virtuoso-t process being started, and can't find any
related entries in system log files.
Also without -w, the virtuoso-t doesn't seem to be launched as a
daemon by launchd.
No the -w flag is incompatible with the way launchd works. This flag
caused virtuoso to fork into background, but returns any problems if
the background process fails to initialize properly. This is useful in
shell scripts where you want to wait until the server is completely
online before continuing with other commands.
I have tried the following settings for launchd and they seem to be
working:
<key>Label</key>
<string>com.openlink.virtuoso-opensource</string>
<key>Program</key>
<string>/usr/local/virtuoso-opensource/bin/virtuoso-t</string>
<key>ProgramArguments</key>
<array>
<string>virtuoso</string>
<string> -f </string>
<string> -c virtuoso.ini </string>
</array>
<key>WorkingDirectory</key>
<string>/usr/local/virtuoso-opensource/database/</string>
With this i was able to start virtuoso with:
launchctl start com.openlink.virtuoso-opensource
Let me know if this works for you too.
My guess is now that one of this (as described in $ man launchd.plist)
happens:
A daemon or agent launched by launchd MUST NOT do the following in the
process directly launched by launchd:
- fork(2) and have the parent process exit(3) or
_exit(2).
- Call daemon(3)
A daemon or agent launched by launchd SHOULD NOT do the following as a
part of their startup initialization:
- Setup the user ID or group ID.
- Setup the working directory.
- chroot(2)
- setsid(2)
- Close "stray" file descriptors.
- Change stdio(3) to /dev/null.
- Setup resource limits with setrusage(2).
- Setup priority with setpriority(2).
- Ignore the SIGTERM signal.
Any suggestions on how to launch virtuoso-t as a launchd daemon are
more than welcome...
Patrick