On Nov 25, 2005, at 7:11 AM, Sébastien Gruhier wrote: The StartupItems /System/Library/StartupItems/WebObjects/WebObjects does not exists anymore in 10.4 but it starts well so it's somewhere else, may be a launchd file.
That's correct. See /System/Library/LaunchDaemons/com.apple.wotaskd.plist. By default, launchd seems to swallow error messages from the processes it starts. But launchd config files support the StandardErrorPath and StandardOutPath keys (man launchd.plist). I added the StandardErrorPath key to com.apple.wotaskd.plist with a value of /var/log/webobjects.log so I now see the same webobjects.log contents as when wotaskd was launched as a startup item.
I don't know what would happen if you merely copied /System/Library/LaunchDaemons/com.apple.wotaskd.plist to /Library/LaunchDaemons/com.apple.wotaskd.plist and added the new keys to the copy. That way, any WO update wouldn't overwrite your changes. But doing so might result in two instances of wotaskd being started. Or maybe launchd is smart enough to ignore the original com.apple.wotaskd.plist.
However, you'll notice that com.apple.wotaskd.plist sets the UserName key's value to appserver and the GroupName key's value to appserverusr. So webobjects.log will need to be writable by appserver:appserverusr. But /var/log is writable by only root:wheel, so as root, I created an empty /var/log/webobjects.log file and changed its ownership to appserver:appserverusr.
You may want to rotate /var/log/webobjects.log because it will grow without bounds otherwise. I decided that a monthly rotation was sufficient for my needs. I created /etc/monthly.local for this purpose. Warning: a month hasn't passed since I installed the following script, so it may not work correctly :-)
#! /bin/sh - # Rotate webobjects.log monthly
log=/var/log/webobjects.log log_num=11
if [ -x /usr/bin/gzip ]; then gzext=".gz" else gzext="" fi while [ "${log_num}" -gt 0 ]; do next_log_num=`expr "${log_num}" - 1`
if [ -f "${log}.${next_log_num}${gzext}" ]; then mv -f "${log}.${next_log_num}${gzext}" "${log}.${log_num}${gzext}" fi log_num=${next_log_num} done if [ -f "${log}" ]; then touch "${log}.$$" && chmod 640 "${log}.$$" && chown appserver:appserverusr "${log}.$$" mv -f "${log}" "${log}.0" && mv "${log}.$$" "${log}" && if [ -x /usr/bin/gzip ]; then gzip -9 "${log}.0"; fi fi
|