Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    mac


Advertisements:






Snow Leopard :: Run Shell Script As Root On Boot


I have the need to run a shell script on boot up as root.It will not run as any other user because the software that the shell script runs requires root permissions, and I don't use my computer as root. I can't run it at login and use sudo because it would ask for a password and hang.How can I have the shell script auto-run at boot (or login) as root?

Information:
MacBook Pro 15" 2.66 Dual Core 4GB RAM
Mac OS X (10.6.3)


View 2 Replies (Posted: Jun 12, 2010)

Sponsored Links:

Related Forum Messages for Mac:
Server V10.6 Snow Leopard :: Can't Get Launchd To Run Shell Script As Root
I'm trying to run a very simple shell script on a regular basis to change permissions on files added to a group of folders on a server. I'm trying to set it up via launchd, since that's what Apple recommends, but when it runs, I get "operation not permitted" errors in the log, which I believe are caused by the script running as admin instead of root. I've tried adding the user variable "root" to the launchd plist, but when I load it that way, the log says it's ignored. Also, it doesn't load at boot. I can load it manually if I use launchctl load from the command line, but seems to run as admin instead of root.

Here's a copy of the launchd plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.mycompany.permissionsfix</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>/usr/local/bin/permissionsfix</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>60</integer>
</dict>
</plist>

It's named "com.mycompany.permissionsfix" and lives in /Library/LaunchDaemons. I believe the permissions are correct (System r/w, Wheel r, Others r). I've verified the script works when called from the command line with sudo.

Other variables that may or may not matter: The folders being targeted live on a SAN volume shared by the server. Server is a current model Xserve, running 10.6.2 server.

Posted: Apr 2, 2010

View 4 Replies!   View Related
Server V10.6 Snow Leopard :: Use Launchd To Run Shell Script At Boot?
I'm trying to create a plist file that will run a shell script at bootup of the server. I have the following xml so far in the plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" [URL]
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.apple.mymount</string>
<key>ProgramArguments</key>
<array>
<string>/mount-script/./mount.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

The shell script is just a mount command:

#!bin/sh
#MOUNT folder X ON server Y
sudo -u _www mount_smbfs -f 777 -d 777 //username:password@server/folder /mnt/mount

The shell script works fine from the terminal. I can see the plist has loaded after bootup but the script doesn't run. what am I doing wrong?

Information:
Mac Mini Server
Mac OS X (10.6.2)

Posted: Mar 15, 2010

View 7 Replies!   View Related
Snow Leopard :: Run Shell Script In Automator
I have a python script I want to run in Automator (update_puzzles.py). I can get the script to run outside of Automator, in Terminal, by navigating to the right directory and typing "python update_puzzles.py". I must not be setting up Run Shell Script correctly. I have it set to /bin/bash and Pass Input to stdin. The command line simply reads python /pathname/update_puzzles.py (where pathname is the path to the .py file, which I got by dragging the file onto the Run Shell Script command window). There are no actions before this in my workflow and the action after is View Results. The log says Run Shell Script failed, and the error is "Traceback (most recent call last):"

Information:
imac
Mac OS X (10.6.2)

Posted: Mar 19, 2010

View 3 Replies!   View Related
Software :: Changing Default Login Shell For Root User
I'm running the latest version of Leopard, and I would like to change the default login shell for the "root" user, but the command which works under Unix and Linux doesn't seem to work here. As root, I have done a vipw to change the shell to /bin/zsh (my preference) on the root line. This change persists in /etc/passwd, and it also gets properly propagated to /etc/master.passwd.

However, every time do an su or a sudo -s, I still get sent into the old /bin/sh shell. I have completely restarted the system, and this still occurs (the /bin/zsh entry is still there for root in /etc/passwd and /etc/master.passwd after reboot). /bin/zsh properly appears in /etc/shells, so I know that this is not the problem.

Posted: Jul 17, 2009

View 1 Replies!   View Related
OS X Leopard :: Pass Video File Name To Run Shell Script
Trying to make an automator script that will 1. Start a video capture, 2. Stop video capture, 3. Rename video, 4. Run Shell Script. Here is the shell script:

for f in "$@"
do
echo "$f"
/usr/bin/podcast --server my.podcast.server --user myself --pass mypass --submit --file $f --workflow "my workflow" --metadata /path/to/file
done

Do I need to create a variable in the automator script to pass it to the script? If I need the variable do I also need to use both Set Value of Variable and Get Value of Variable? If I don't need a variable does $f need quotes around them?

Information:
Quad G5
Mac OS X (10.4.9)

Posted: Jan 29, 2009

View 3 Replies!   View Related
OS X :: How To Run ITunes Across Multiple User Accounts - Run It As Root?
I currently have itunes on two accounts set to access a library at /Users/shared/iTunes/. The problem is if iTunes is running on one account and I try to launch it on the other, it gives an error saying it doesn't have write access. It needs to stay running on one for my appletv. Is there a way to start it and have all accounts have access to it as a single process? Run it as root?

Posted: May 30, 2010

View 7 Replies!   View Related
Snow Leopard :: Boot Drive Died - Any Way To Run Disk Utility?
My boot drive in my Mac Pro just died (blue screen of death) But I have it back up and running with a bootable copy that I made of that drive, my question is, I would like to see if I could somehow mount this dead drive to see if I run disk utility on it, When I put it in the drive bay with the bootable copy I have running now, on startup, it just goes back to the blue screen, any tips on how to do this.

Information:
Mac Pro 2.26 Ghz
iMac 24" 2.8Ghz
Powermac G4 Quicksilver 2002
Mac OS X (10.5.6)

Posted: Dec 1, 2009

View 6 Replies!   View Related
OS X :: Full Pathname To Run Shell Script?
I'm trying to create a shell script or compile it into an application using automator that runs a JAR file. Everything works great except that I have to specify the full pathname in the shell script. I thought that ./ or .../ or something similar would denote that I want to run the .JAR file that is in the containing folder but I'm not having any luck.

Posted: Oct 3, 2010

View 7 Replies!   View Related
OS X :: Run Two Things Simultaneously Via One Shell Script?
Can you run two things simotaniously via one shell script?

Posted: Apr 17, 2009

View 1 Replies!   View Related
OS X Leopard :: Cannot Boot After Changing Root Level Privileges
While setting up two macs to network, I changed Root level "privileges" on "Everyone" from "read only" to "no access." Now the computer won't get to a login screen (endless looping). I can boot from the OS X disk, or single user, but don't know where to go from there.

Information:
Mac OS X (10.5.1)
IMAC G4

Posted: Jan 31, 2009

View 1 Replies!   View Related
Software :: Run Shell Script Before Shutdown With Launchd?
Is there a way to run a shell script before shutdown with launchd? In 10.4, I have a shell script to remove user's folder when a user logs off. how to do a rc.shutdown in 10.5

Posted: Nov 17, 2008

View 1 Replies!   View Related
OS X Technologies :: Folder Action To Run A Shell Script
I want to create a Folder Action to run the following shell script on all files with extension .vcs: 

sed '1d' >reminder.ics 

The job of the Folder Action is to take any Calendar item files downloaded from TVGuide.co.uk, remove the first line and then save them as .ics files.  The reason for this is that the files are automatically generated with a carriage return on the first line, which BusyCal (being strict about these things) doesn't like.  It then rejects the whole file. 

I have tried doing this with Automator but the result didn't work. 

If it's possible to have the Folder Action retain the original file name (ie. everything pre-extension) that'd be a bonus. 

Info:
Mac mini (Mid 2011), Mac OS X (10.7.4)

Posted: Aug 7, 2012

View 4 Replies!   View Related
Software :: Fan Speed Stuck Via Run Script Shell
I was playing with terminal and run a script shell: /Applications/smcFanControl.app/Contents/Resources/smc -k F0Mx -w 2e80 in shell bin/bash and now my fan is going back to the 3000 rpm speed even though I change in smcfancontrol to 5000 or whatever speed. Could you help me clear the command so the fan will run normal again?

Posted: Jun 28, 2010

View 2 Replies!   View Related
OS X :: Enable Root User In Snow Leopard?
enabling root user in Snow Leopard (10A421). I tried to find the directory utility in utitlites but couldn't find it. I read in other threads that Directory utility has been removed and all the functionality is moved to user accounts. But didn't find how to enable the root user.

Posted: Jul 26, 2009

View 7 Replies!   View Related
Snow Leopard :: Enabling Root User On Mac?
I have enable the root user on my Mac. I had to do so to change some privileges on a hard drive. Now that I have I was wonder what can you do on the root user that you cant do as a regular user. I know that you can (as I said above) change permissions but what else? A lot of people say to enable it but I was wondering why?

Information:
iMac Intel (10.6.3)
MacBook (10.6.3)
iMac G5 PowerPC (10.5.8)

Posted: Jun 14, 2010

View 2 Replies!   View Related
OS X V10.6 Snow Leopard :: How To Install Root Certificates
how do i install root certificates

Info:
Mac OS X (10.5.6)

Posted: Mar 5, 2012

View 1 Replies!   View Related
Snow Leopard :: Root User Setup And Directory Utility?
How is the root user set up in Snow Leopard. I didn't find the Directory Utility app.

Information:
Mac OS X (10.6)

Posted: Sep 10, 2009

View 2 Replies!   View Related
Snow Leopard :: SD Card Formatting - No Proper Root Directory
Since snow leopard has been installed when I format an sd card it doesn't seem to do it properly as when I put the card in my camera it says error and I have to reformat it in the camera and then its fine? I've used 2 diff card readers and its the same doesn't seem to make a proper root directory, but was fine.

Information:
imac duo
Mac OS X (10.6)

Posted: Sep 14, 2009

View 1 Replies!   View Related
Server V10.6 Snow Leopard :: Unable To Login As Root Via GUI
Unable to log in as root via GUI. Login window doesn't accept password. Enabled Root via Directory Utility and changed password. Still unable to log in.

Information:
Xserve
Mac OS X (10.6.2)

Posted: Jan 23, 2010

View 2 Replies!   View Related
Server V10.6 Snow Leopard :: New Accounts Owned By Root Not New User
When I create new user accounts in Workgroup Manager (authenticated in as diradmin) the whole user directory structure that's created in /users/xxx is owned by root not by the new user ... so the new user is unable to create any files.

Posted: Jul 5, 2010

View 1 Replies!   View Related
Snow Leopard :: Backup Restore From IOmega NAS (Root Password)
I cannot access to my IOmega Multimedia Network Hard Drive. When booting the System with the Installation DVD I can successful connect to my Wifi Network and find my NAS. But then OSX requires a Username and a password for the connection with my NAS. To be honest, I have no idea what username/password combination is needed. My OS X profile combination does not work and the one I use to have usual access to the NAS also fails.

Information:
MacBook Pro
Mac OS X (10.6.4)

Posted: Oct 29, 2010

View 5 Replies!   View Related
Server V10.6 Snow Leopard :: Cannot Login As Root Or Admin After OS X Update
Upgrading to Mac OS X Server Update 10.6.5. After restart I cannot log in anymore. Has anybody encountered similar issue? I'm am 1000% sure I'm using correct you/pw because I store them encrypted in a safe place.

Information:
Mac Mini Server
Mac OS X (10.6.4)

Posted: Nov 20, 2010

View 4 Replies!   View Related
Server V10.6 Snow Leopard :: Folder Refreshes To Share Root
I have been chasing an odd problem for quite a while. When the user clicks on a client folder it will go to the root of the share instead of opening the client folder. It also seems to refresh to the root when your scrolling down the list of folders. Other times it will just refresh over and over every 2 seconds or so. I assume the issues are related. If you keep trying it seems to work eventually. This started with one user and now seems to be affecting them all. The server is running 10.6.5. I just updated from 10.6.3 in attempt to fix this.

The clients are running either 10.5.x or 10.6.x I have not built a list of the client versions. The clients also complain of disappearing folders and folders that don't delete but I have not been able to duplicate those problems. For example: /share/clients/client A
When you open client A it takes you to /share. We use AFP for file sharing. I have tried many different things over the last several months. This weekend I copied everything off, formatted the share drive and copied everything back on. It did not help. I have propagated permissions down the folder hierarchy to make sure it was not a permissions issue.

Information:
x Serve
Mac OS X (10.6.5)

Posted: Dec 15, 2010

View 3 Replies!   View Related
Hardware :: How To Boot And Holding Down Command-S To Reset The Root Password
My friend. a student, had a problem with this emac 700Mhz ,384 MB ram,no floppy,no optical drive it was about 9 years old.When it is turned on it took a bout a minute for the CRT monitor to turn on Its OS is about 10.4 and something All i tried to show you that it is not worth spending much on this emac Now it losts it root account

how to boot and "holding down Command-S" to reset the root password

Posted: Jul 11, 2009

View 2 Replies!   View Related
Server V10.6 Snow Leopard :: Login As Root User (GUI Account)
I am trying to login as the root user at the login screen, but it doesn't seem to work. I have found the "directory utility" and checked that the root user is indeed enabled. I can use the root user in the terminal as usual with "su" or "sudo", but I can't login on the root users GUI account. It always worked fine in 10.5 Server, and older versions.

Information:
MacBook PRO
Mac OS X (10.6.2)

Posted: Nov 25, 2009

View 1 Replies!   View Related
OS X Server V10.6 Snow Leopard :: Cannot Login As Root Or Admin Anymore After OSX Update And Restart
[URL] I can access via server admin but cannot log into the server from the login window at the server itself with the exact same admin credentials that I used through server admin. 

Posted: Jun 1, 2012

View 5 Replies!   View Related
OS X Leopard :: Slow Boot Up - How To Make It Run Best
When I upgraded to Leopard, I also transferred all my music and iphoto libraries to an external hard drive to free up space on the main drive in my imac, I thought this would make things a bit quicker to boot up, but it's still a lot slower than it used to be before Leopard. I downloaded all the updates and I check and repair permissions frequently, so what do you think might be the problem? Are there any other useful (built in) utilities that I can run to make sure things are running at their best?

Information:
MacBook Pro 15.4in, 60GB iPod Video, Intel iMac 20" 16GB iPhone 3G
Mac OS X (10.5.7)

Posted: Oct 25, 2009

View 4 Replies!   View Related
Server V10.5 Leopard :: How To Run A Single Line Of Code On Boot
I have a single line of code that I need to run in Terminal every time I reboot my G5 server (the single line of code "turns on" my SVN server). How would I go about automating this on boot?

Information:
20" Intel iMac 2.16 Ghz, Macintosh SE/30
Mac OS X (10.6.2)
Xserves (Early 2009, Early 2008, G5), Mac Pro

Posted: Mar 31, 2010

View 1 Replies!   View Related
OS X Leopard :: How To Use Shell Script In Terminal
I've seen the need of automating some tasks in the Terminal and I believe using shell scripts is my solution, although I don't really even understand how they work. Any good comprehensive guide for someone who never used any programming language, yet knows how to work a bit with the Terminal? I will figure out the command I will need to input in the Terminal myself, by testing. Once it's figured all I need is to make a shell script out of it, and perhaps make an application out of it. (Automator? ... or more Script Editor? Or? After seeing this page [URL] I believed to have found a great solution for some heavy cryptography, to protect some folder and for learning pleasure.

What I wanted to do is to automate the openssl task mostly like this: Open my flash drive (or a certain folder) containing a disk image (uncompressed, or compressed if necessary, doesn't matter) but uncrypted. Clicking on something I will name 'Lock' for the moment will run the shell script, encrypting the said image with pre-set parameters and a password I will input when prompted by the app. Re-running the app will prompt me a password and simply un-encrypt the image, making it useable for me. That's all. Perhaps if I can do it, I'll make it prompt me what cipher and all other parameter to use, but I don't understand openssl very well yet. I just read and understood more or less informations on that page. Who knows, I'll end up with a sweet GUI for encrypting files usable by the common mortals.

Information:
Mac Pro Quad-Core @ 2.66Ghz 3GB
Mac OS X (10.5.5)

Posted: Jan 24, 2009

View 6 Replies!   View Related
OS X Leopard :: Terminal Ignoring .profile When Loading New Shell
I have this in my .profile: export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" I have Terminal set to open the default login shell. This is what happens: cmykG5:~ cmyk$ echo $PATH/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/local/mysql/bin:/usr/local/sbin

And, mind you, this is after I have set the .profile, have quit Terminal and reopened it. So, it should respect the new Paths I added. And if I do load the .profile manually: cmykG5:~ cmyk$ . .profilecmykG5:~ cmyk$ echo $PATH/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/local/mysql/bin:/usr/local/sbin

Information:
G5 2x2.7
Mac OS X (10.5)

Posted: Mar 15, 2009

View 7 Replies!   View Related
IMac Intel :: Corrupt Boot Disc, Boot From OSX Disc To Run Repair Disc?
I have just run Verify Disc and it has identified problems which requires me to boot from my OSX disc and run Repair disc.I think I do this by switching on while holding down C....is that right?ALSO I can only find my Leopard boot discs and I am currently running Snow Leopard....do I NEED to use the Snow Leopard discs to boot up?

Information:
iMac 24inch
Mac OS X (10.6.4)

Posted: Dec 30, 2010

View 6 Replies!   View Related
Snow Leopard :: Not Been Able To Run Vista
Since installing snow leopard, I've not been able to run Vista.

Posted: Dec 2, 2009

View 5 Replies!   View Related
OS X :: How To Run Jaguar On Snow Leopard
I would like to run Mac OS X Jaguar and earlier, virtualized on my MacBook. I am talking about the same way I can run Windows 95 on current versions of Windows by using Virtual PC.

What software can I use to accomplish this on the Mac?

Posted: Oct 31, 2010

View 15 Replies!   View Related
OS X :: Do Not Run Snow Leopard In 64bit
Contrary to belief, Snow Leopard by default (except for Xserves) runs in 32-bit mode. Check for yourself.

Code:
uname - a
You should see something similar

Code:
root:xnu-1456.1.25~1/RELEASE_I386 i386
I forced it to 64-bit on my '08 Mac Pro and things were slower! Spaces was very slow. Dashboard was quirky. I say avoid it.

Posted: Aug 28, 2009

View 17 Replies!   View Related
Snow Leopard :: Macbook Pro - Snow Leopard - Will Not Boot After Software Update
I helped my mom buy a Macbook Pro for herself for Christmas. Today, I connected it to her old eMac and used the migration assistant to transfer files over. It was unable to estimate migration time on the only user (after 45 minutes) so I didn't migrate the user. Then I tried to pair her macbook to her new bluetooth keyboard, but no magic happened, so I tried to use the bluetooth setup assistant, which crashed. So I ran a software update, hoping that this would fix whatever the bluetooth problem is. Despite having updated on the 23rd, there were 4 updates. None seemed applicable but I installed them anyway. Now the computer won't boot at all.

Software update said that I had to restart for the updates to take effect, so I restarted. The harddrive went whirrrrrr and the grey screen with the apple logo and the spinning circle displayed. Then the harddrive stopped going whirrrr and 10 minutes later, I started looking on the support site for what to do. I found this: http://discussions.apple.com/thread.jspa?messageID=10564149&#10564149

Per the instructions in the last post, I fscked the drive (although -f, in accordance with the fsck help). This found no problems. The next suggestion was to boot from the OSX install disk. Only one problem-- there was a disk in the disk drive when the problem occurred and the disk eject button apparently only works while in the gui. I can't install from disk if I can't get the existing disk out of the drive.

Posted: Dec 28, 2009

View 2 Replies!   View Related
Snow Leopard :: Rules Only Run In Inbox ?
Do rules only run against messages in Inbox? I have multiple IMAP mail servers that have spam services at the host. This means I have a corresponding Spam folder in my IMAP folders. I get at least 20 spam messages a day from email.bwz.net and I created a rule to automatically delete them.

If I select all the messages in my Spam folder, right click and select 'run rules' then the messages get deleted. Is there a way to tell Mail to run rules against all the downloaded mail?

Posted: Mar 1, 2010

View 10 Replies!   View Related
Snow Leopard :: Run Automator With New File
I am starting to make Automator workflows for my Mac and love how easy it is. I have one question, how do I make the workflow run every time I put a file in a directory?

Information:
2.4GHz Intel i5 15" Laptop
Mac OS X (10.6.3)
4GB 1067MHz DDR3

Posted: Jun 9, 2010

View 1 Replies!   View Related
Desktops :: Snow Leopard Will Run On A 1G EMac?
I found some discussions here re: using Leopard OS with eMacs. Anyone know if Snow Leopard will run on a 1G eMac? I have Family Pack OS installation disks for 10.5.1 and Snow Leopard 10.6

Think they will run OK on eMac?

Posted: Nov 19, 2010

View 1 Replies!   View Related
OS X :: Snow Leopard CD Doesn't Run?
I have a MB Pro 15'' that's almost 4 years old (=it's the previous model).

I bought a Snow Leopard CD to upgrade from 10.5.8 a few days ago. I tried it on Thursday and the driver wouldn't accept it, it would try a bit to run but then it would get spitted out. I assumed it is because of the scratches the CD had. So I bought another one. And I am having the exact same problem: Although the CD is in perfect conditions, it just won't run. This time the driver tries a bit harder (I can tell by the sounds) but in the end it just won't get accepted.

Posted: Dec 26, 2010

View 12 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved