Autostart error -OSX 10.4 (Intel)

#1
Just switched from running LiteSpeed on OSX 10.3 to a new machine(Mac Intel duo, 10.4.) Installed 2.1.15 std for Intel and received the following error during installation when trying to set to autostart on boot: "failed to find init.d directory"

Server is working fine - but have to manually start. Help:confused:
 

xing

LiteSpeed Staff
#2
Thank you for bringing this to our attention. We have confirmed this error. The installer is not able insert a boot-up startup script for Mac OS X 10.4. We will fix this shortly.
 

mistwang

LiteSpeed Staff
#3
Please use the attached script to replace lsws/admin/misc/rc-inst.sh and run it again.

Oops, Problem with attaching file, trying to fix it now.

All right, gave up, insert the following code in to rc-inst.sh, below 'INIT_DIR="" ' line

if [ "x`uname -s`" = "xDarwin" ]; then

STARTUP_ITEM=/System/Library/StartupItems/lsws
if [ ! -d $STARTUP_ITEM ]; then
mkdir $STARTUP_ITEM
fi
cp "$CURDIR/lsws.rc" $STARTUP_ITEM/lsws
cat <<EOF >$STARTUP_ITEM/StartupParameters.plist
{
Description = "LiteSpeed web server";
Provides = ("Web Server");
Requires = ("DirectoryServices");
Uses = ("Disks", "NFS");
OrderPreference = "None";
}

EOF
 
Last edited:
#4
Hi -Thanks for the help. I modified the file and it creates the lsws folder and startup files in /system/library/startupitems just fine but still will not autostart on boot. Think its perhaps a user id problem - I can manually run the startup file as root "/system/library/startupitems/lsws/lsws start " but not as my normal user id. Same goes for starting from lswsctrl - have to be root. I tried deleting the /tmp/lshttpd folder as mentioned in FAQs - but didn't help. I installed LiteSpeed as root .... but did the same on my previous system (10.3 - Panther) and was able to start as my normal user and autostart worked
 

mistwang

LiteSpeed Staff
#5
You should install those files as root user, using command like
"sudo ..."

The web server has to be started on behalf of root user as it may bind to priviledge TCP port, and there might be other permisssion problems.
Check your lsws/logs/error.log, see if you can find anything useful.
 
Last edited:
#6
Found some info (sorry didn't copy links) regarding OSX 10.4 being the first version to disallow running startup items as root ... saying that this was a big security concern in previous versions ...anyway seems to be the case!

I came up with a novice(me) workaround to get LiteSpeed started at boot:
I first edited the "sudoers" file (/etc/sudoers) with built in editor "visudo" (http://forums.macosxhints.com/archive/index.php/t-21178.html ) to allow sudo command to be executed by my user ID with no password prompt - and then I created a simple Applescript with this one line:

do shell script "sudo /applications/lsws/bin/lswsctrl start"

saved it as an application and then just added it to my list of login items for my user id in System Preferences - it works!
 
#8
hi,

Found some info (sorry didn't copy links) regarding OSX 10.4 being the first version to disallow running startup items as root ... saying that this was a big security concern in previous versions ...anyway seems to be the case!

I came up with a novice(me) workaround to get LiteSpeed started at boot:
I first edited the "sudoers" file (/etc/sudoers) with built in editor "visudo" (http://forums.macosxhints.com/archiv...p/t-21178.html ) to allow sudo command to be executed by my user ID with no password prompt - and then I created a simple Applescript with this one line:

do shell script "sudo /applications/lsws/bin/lswsctrl start"

saved it as an application and then just added it to my list of login items for my user id in System Preferences - it works!

You should install those files as root user, using command like
"sudo ..."

The web server has to be started on behalf of root user as it may bind to priviledge TCP port, and there might be other permisssion problems.
Check your lsws/logs/error.log, see if you can find anything useful.:cool::cool:
 
Top