Re: Need to use 'sudo' in an installer script
Re: Need to use 'sudo' in an installer script
- Subject: Re: Need to use 'sudo' in an installer script
- From: John Daniel <email@hidden>
- Date: Fri, 29 Dec 2006 18:46:09 -0600
Just make sure your installer uses AdminAuthorization. Then, the postinstall scripts will be run with Administrator rights. The user will be asked for an administrator password before installing. You will not have to explicitly say "sudo" as you will already be administrator. That will solve your immediate problem. It will also create some new ones.
You will have to make sure all of the files you install have the appropriate ownership and permissions. When run as Administrator, the installer will create files exactly as they are in the archive.pax.gz file. That mean that if they are owned by bweitzer when you create the installer, they will be owned by bweitzer on the user's machine. That is actually a slight exaggeration, but only slight. They files will have your user id which will "probably" work fine. Don't count on it though. Test, test, and re-test.
Also, it would be best to start services using the SystemStarter script. You should do something like "SystemStarter start MySQL".
John Daniel On Dec 29, 2006, at 6:25 PM, Brian Weitzner wrote: Hi, I am new to PackageMaker and this list. I am writing a database app that I need to create the database in a preinstall script. In order to do this, I need to check if the database server is running and start it if it is not. However, you need administrative rights to start the database. The commands
sudo /Library/StartUpItems/MySQLCOM/MySQLCOM start or sudo /usr/local/mysql/support-files/mysql.server start
work just fine for this, but a password is needed. How can I get the installer to use the user's password to do this? Or is there another way to do this that would not require using "sudo?" Thanks! |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden