PDA

View Full Version : Manually Start a StartUp Item


filip
12-27-2005, 06:00 PM
Can someone please tell me how to manually start an item located in the /Library/StartUpItems/

I am using twinkymedia to stream music to xbox360 and the media server sometimes shuts down. The only way of starting it up atm for me is to restart my mac.

Much appreciated,

filip

yellow
12-27-2005, 08:43 PM
Generally a Startup Item in /Library/StartupItems/ has a script that is run at start up. All you have to do is find the script and run it in the Terminal. For example, Timbuktu has a startup item..

yellow% ls -laF /Library/StartupItems/TimbuktuStartup/
total 16
drwxr-xr-x 4 root wheel 136 Mar 25 2005 ./
drwxr-xr-x 6 root wheel 204 Oct 13 13:07 ../
-rw-r--r-- 1 root wheel 638 Mar 11 2003 StartupParameters.plist
-rwxr-xr-x 1 root wheel 430 Mar 25 2005 TimbuktuStartup*

The script is the executable one, TimbuktuStartup. Looking at it:

yellow% more TimbuktuStartup
#!/bin/sh

##
# Start Timbuktu Host Relauncher
##
# WARNING: Be careful to preserve Unix line endings in this file.
#

. /etc/rc.common

ConsoleMessage "Starting Timbuktu Host"

'/Applications/Timbuktu Pro/Timbuktu Pro.app/Contents/SharedSupport/Host Relauncher' '/System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp' '/Applications/Timbuktu Pro/Timbuktu Pro.app/Contents/SharedSupport/Timbuktu Extension'

It's just a shell script. So to invoke it, all I have to do is (if I am in the directory that the shell script is in):

yellow% sudo ./TimbuktuStartup
Password:
Starting Timbuktu Host

Enter my admin password, and it restarts.

forbin
12-27-2005, 08:51 PM
Take a look at 'launchctl' typically 'launchctl start plistname' can be used to start a startup item

blb
12-27-2005, 10:24 PM
Generally a Startup Item in /Library/StartupItems/ has a script that is run at start up. All you have to do is find the script and run it in the Terminal. For example, Timbuktu has a startup item..
...
If you want to go through all the steps the OS would (including it making sure prerequisites are started), use SystemStarter:

sudo /sbin/SystemStarter start TimbuktuStartup

See the SystemStarter manpage for details.

filip
12-28-2005, 05:40 AM
Thanks guys.

I tried all three ways of doing it. The first i get this message:


$ sudo ./MediaServer ./MediaServer: line 52: $1: unbound variable

then i went into the workdir=/usr/local/mediaserver where the script points to and did the same thing "sudo ./MediaServer" the server starts running but as soon as i quit terminal it stops.

the second "launchctl start plistname" comes back with a message

drwxr-xr-x 6 root wheel 204 Dec 22 18:26 .
drwxr-xr-x 10 root wheel 340 Dec 22 18:26 ..
-rw-r--r-- 1 root wheel 6148 Nov 25 08:55 .DS_Store
-rwxr-xr-x 1 root wheel 838 Dec 20 12:25 MediaServer
drwxr-xr-x 5 root wheel 170 Dec 22 18:26 Resources
-rwxr-xr-x 1 root wheel 658 Apr 27 2005 StartupParameters.plist
Filips-PowerBook-G4:/Library/StartupItems/MediaServer filip$ launchctl start StartupParameters.plist
launchctl start error: No such process


Now, the third option:

Filips-PowerBook-G4:/Library/StartupItems/MediaServer filip$ sudo /sbin/SystemStarter start MediaServer
No matching processes were found
rm: mediaserver: No such file or directory
No matching processes were found
rm: twonkymusic: No such file or directory
No matching processes were found
rm: twonkymedia-trial: No such file or directory
TwonkyMedia Version 3.0
Filips-PowerBook-G4:/Library/StartupItems/MediaServer filip$


hmm...i cant get any of these to work.
am I doing something wrong ?

Thanx

filip
12-28-2005, 05:44 AM
actually guys , this command seems to have done it. Its now running again.

Filips-PowerBook-G4:/Library/StartupItems/MediaServer filip$ sudo /sbin/SystemStarter start MediaServer
No matching processes were found
rm: mediaserver: No such file or directory
No matching processes were found
rm: twonkymusic: No such file or directory
No matching processes were found
rm: twonkymedia-trial: No such file or directory
TwonkyMedia Version 3.0
Filips-PowerBook-G4:/Library/StartupItems/MediaServer filip$

Many Thanks !