Active Topics

 


Reply
Thread Tools
flotron's Avatar
Posts: 418 | Thanked: 506 times | Joined on Jan 2012 @ Argentina
#1
I'm making a theme packaged on deb.
The theme require to modify some files inside /usr/share/themes/base/meegotouch. It modifies succesfully those file s when i add the script to the posinst file BUT now i want to modify that files by a desktop icon that run an SH script that run commands like /sbin/initctl restart xsession/mthome or symlink inside /usr/share/themes/base/meegotouch/libmeegotouchhome/style but these ones doesn't work.

I don't have permission? I tried chmod +x script.sh on the postinst but no luck

Maybe the script should be placed in other folder? (now is in /opt/theme)

Last edited by flotron; 2013-03-22 at 21:08.
 
Posts: 578 | Thanked: 994 times | Joined on Dec 2012
#2
I guess you need to be root user so try run commands with sudo.
 
flotron's Avatar
Posts: 418 | Thanked: 506 times | Joined on Jan 2012 @ Argentina
#3
but if you run commands in sudo the user must enter the password?
and why this script is working when is inside the postinst but not in the script.sh?
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#4
You need to put a file "myApp.sudoers" into /etc/sudoers.d/
with a content like
user ALL = NOPASSWD: /path/to/script/scriptname
and call in postinst 'update-sudoers'.
Then you may call the script with sudo without requiring a password.

--edit
This guide is only valid for normal debian based systems. For Harmattans cripped aegisfs there needs to be obeyed a few things more ...
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2013-03-23 at 10:04. Reason: aegis disclaimer
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
flotron's Avatar
Posts: 418 | Thanked: 506 times | Joined on Jan 2012 @ Argentina
#5
sorry for be insisten but why this script is working when is inside the postinst but not in the script.sh?
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#6
postinst is executed as root.
Did you try to run the script with sudo or as root?
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 
flotron's Avatar
Posts: 418 | Thanked: 506 times | Joined on Jan 2012 @ Argentina
#7
So.. if i execute this: ln -s /opt/mytheme /usr/share/themes
With sudo would be:

Code:
sudo ln -s /opt/mytheme usr/share/themes
 
flotron's Avatar
Posts: 418 | Thanked: 506 times | Joined on Jan 2012 @ Argentina
#8
Originally Posted by peterleinchen View Post
You need to put a file "myApp.sudoers" into /etc/sudoers.d/
with a content like
and call in postinst 'update-sudoers'.
Then you may call the script with sudo without requiring a password.
not working

I tried to add sudo in the desktop icon too but nothing..

Code:
[Desktop Entry]
Type=Application
Name=My Theme
Exec=sudo /opt/mytheme/changer/script.sh
Icon=/opt/mytheme/icon/icon.png
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable

Last edited by flotron; 2013-03-22 at 22:59.
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#9
Instead of guessing around: what exactly is not working? Which errors?
What is the content of your script?
Forgot the shebang?
Does the script work when executed as root?
???
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2013-03-22 at 23:20.
 
flotron's Avatar
Posts: 418 | Thanked: 506 times | Joined on Jan 2012 @ Argentina
#10
Sorry i forgot to answer that..

Yes is working manually via terminal with root
 
Reply

Tags
chmod, debian, permission, script, theme


 
Forum Jump


All times are GMT. The time now is 02:07.