Active Topics

 


Reply
Thread Tools
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#11
Originally Posted by mece View Post
without any modifications to sudoers and whatnot you can use run-standalone.sh like this:

sudo /usr/bin/run-standalone.sh /path/to/runthisscriptasroot.sh

That will run "runthisscriptasroot.sh" as root.

EDIT:
tested it with this script:

#!/bin/sh
whoami > whoami.txt

works
Hmm, i am also having a similiar problem,
I tried
Code:
sudo /usr/bin/run-standalone.sh /opt/script.sh
but i am getting error:
Code:
standalone.sh: line 11: /opt/script.sh:permission denied.
Please help
__________________
My Device History:Nokia 3510 > SE T230 > Nokia 6600 > HP2210 > SE p910i > SE p990i > N95 > I-mate 9502 > itouch > Nokia N900 > ? N9
My apps for N900:
Conversation Modder

My apps for N9:
LockScreenQuotes
USbS


If you feel I have helped you, don't forget to press Thanks!
 
Tiboric's Avatar
Posts: 433 | Thanked: 312 times | Joined on Nov 2009 @ U.K
#12
sudo run-standalone.sh /opt/shortcutmkr/main.py
is how i launch SCM with root privileges also have to
sudo chmod +x main.py
to get it to run.
__________________
Shortcut Maker. A GUI for .desktop shortcuts
SMS Faker. A very simple sms faker
 

The Following User Says Thank You to Tiboric For This Useful Post:
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#13
Originally Posted by Tiboric;961024[CODE
]sudo chmod +x main.py[/CODE]
to get it to run.
So do i make it so that sudo chmod +x script.sh is done automatically after install? I am trying to make a deb package
__________________
My Device History:Nokia 3510 > SE T230 > Nokia 6600 > HP2210 > SE p910i > SE p990i > N95 > I-mate 9502 > itouch > Nokia N900 > ? N9
My apps for N900:
Conversation Modder

My apps for N9:
LockScreenQuotes
USbS


If you feel I have helped you, don't forget to press Thanks!
 
Posts: 44 | Thanked: 11 times | Joined on Oct 2009 @ UK, Manchester
#14
as root

chown root YOURFILE
chmod 4775 YOURFILE

voila!
 
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#15
Originally Posted by CharlesM View Post
as root

chown root YOURFILE
chmod 4775 YOURFILE

voila!
Yes, but these commands have to be performed by the users right?

What I want is, after instaling the deb file, the users should be able to start the app normally but it should have root priviledges. For refrerence, this are the scripts that I am planning to make into a package.
So, while creating the deb file, in the .desktop file, for exec=, what command should I give? Right now i tried with
Code:
sudo run-stanalone.sh /opt/script.sh
But no luck.

Am I doing something glaringly obvious and dumb here?
__________________
My Device History:Nokia 3510 > SE T230 > Nokia 6600 > HP2210 > SE p910i > SE p990i > N95 > I-mate 9502 > itouch > Nokia N900 > ? N9
My apps for N900:
Conversation Modder

My apps for N9:
LockScreenQuotes
USbS


If you feel I have helped you, don't forget to press Thanks!
 
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#16
OK, i have finally figured out how to run some of scripts as root, when started by user.
I have a bunch of 5 scripts, with a main script acting as the menu or gateway. The main script is launched normally via an icon as
Code:
sh parentscript.sh
in that script, it calls the other scripts as
Code:
sudo run-standalone.sh sh childscript1.sh
This methodology seems to be working for me. But one the users of this app is having a problem that xterm is asking for password on execution of sudo run-standalon.sh.

Can anybody help us?
__________________
My Device History:Nokia 3510 > SE T230 > Nokia 6600 > HP2210 > SE p910i > SE p990i > N95 > I-mate 9502 > itouch > Nokia N900 > ? N9
My apps for N900:
Conversation Modder

My apps for N9:
LockScreenQuotes
USbS


If you feel I have helped you, don't forget to press Thanks!
 
Posts: 38 | Thanked: 33 times | Joined on Aug 2010 @ Bangalore, India
#17
There's another method that works great which I saw based on this:

http://talk.maemo.org/showpost.php?p...1&postcount=16

From the above link (disable_ts.zip)

If you put this in a script file:
Code:
sh -c 'echo "sleep 1; echo 1 > /sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts" | sudo gainroot'
echo 1 > /sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts should fail as permission denied if executed as normal user since it is modifying a sysfs file. But the above method of piping to sudo gainroot works!
 

The Following 2 Users Say Thank You to kitwalker For This Useful Post:
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#18
Hey thanks a lot! piping the command to sudo gainroot works like a charm!
__________________
My Device History:Nokia 3510 > SE T230 > Nokia 6600 > HP2210 > SE p910i > SE p990i > N95 > I-mate 9502 > itouch > Nokia N900 > ? N9
My apps for N900:
Conversation Modder

My apps for N9:
LockScreenQuotes
USbS


If you feel I have helped you, don't forget to press Thanks!
 
Tiboric's Avatar
Posts: 433 | Thanked: 312 times | Joined on Nov 2009 @ U.K
#19
Originally Posted by ejasmudar View Post
So do i make it so that sudo chmod +x script.sh is done automatically after install? I am trying to make a deb package
yes in your postinstall script
__________________
Shortcut Maker. A GUI for .desktop shortcuts
SMS Faker. A very simple sms faker
 

The Following User Says Thank You to Tiboric For This Useful Post:
Posts: 21 | Thanked: 42 times | Joined on Jan 2010
#20
Setting permissions in the postinst is a band-aid. The correct permissions should already have been in the packed deb, i.e. the permissions should preferably be set in debian/rules or other makefile/buildscript, not in the package postinst.

Last edited by ovekaaven; 2011-03-16 at 23:04.
 
Reply


 
Forum Jump


All times are GMT. The time now is 05:56.