Install script needs root access - is this possible?

taapie
Posts: 2
Joined: Wed Aug 15, 2012 7:38 am

Install script needs root access - is this possible?

Postby taapie » Fri Sep 28, 2012 5:04 am

I am currently working on a new Amahi App called MediaRip to allow servers to rip audio-cd's and dvd's.

There is one thing which i would like to add and that is a new udev rule to automatically trigger on an inserted disc in a cd/dvd-drive. To make this happen i need to add the following line to a new file in /etc/udev/rules.d/

echo 'SUBSYSTEM=="block", KERNEL=="sr0", RUN+="/usr/local/bin/udevdisc", OPTIONS="last_rule"'

The /etc/udev directories are owned by root and so the install script can not just do this. Is there a way around this, or does this functionality need to be added in a different way. I am planning to create a web interface when everything is working, so i could add a setting there. But this is really a last alternative.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Install script needs root access - is this possible?

Postby bigfoot65 » Fri Sep 28, 2012 6:26 am

Yes, however you need to be careful doing too much in an app install with elevated privileges. It can be disastrous.

There is guidance here:

http://wiki.amahi.org/index.php/Web_App_Packaging_Notes
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

taapie
Posts: 2
Joined: Wed Aug 15, 2012 7:38 am

Re: Install script needs root access - is this possible?

Postby taapie » Fri Sep 28, 2012 6:48 am

That is a great page, thanks for that link ! It is really difficult to find this kind of information on the wiki :-)

I will use this with care.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Install script needs root access - is this possible?

Postby bigfoot65 » Fri Sep 28, 2012 7:46 am

No problem. That is all the stuff I have compiled over the years. Finding it in the wiki should be easy with a search.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

Who is online

Users browsing this forum: No registered users and 17 guests