LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-13-2005, 04:18 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,475

Rep: Reputation: 87
How to execute root-privilege programs in KDE autostart?


Hi guys

How can I execute privileged operations (I want to run chmod and hdparm) whenever KDE starts up? I have tried putting a script in the ~/.kde/AutoStart directory, but since KDE runs as a normal user, the operations chmod and hdparm are to execute seem to fail. (This can also be because maybe KDE is not executing the script - see below).

1. Is this the correct way to use KDE's autostart? I. e. by placing executables or scripts into ~/.kde/AutoStart? Or do I need to somehow create a file that has the autostart "format", like

[Desktop Entry]
Exec=xscreensaver
Name=XScreensaver
Type=Application
X-KDE-StartupNotify=false

where "Exec=sh -f myscript.sh" and "Type=Script" and the file is called, say, startup.desktop?? So far, neither seem to work - just dropping the script in /Autostart, and creating such a "desktop format" file...

2. How can I run chmod and hdparm with root privs, without being root, if I can get autostart to execute my script as in (1) above?

Thanks - any help appreciated!

Regards,
 
Old 07-13-2005, 05:25 AM   #2
Michael Johnson
Member
 
Registered: Jul 2005
Location: Wagga Wagga, Australia
Posts: 262

Rep: Reputation: 30
The hdparm command can be put in your init scripts so that it executes during the boot sequence.
Why do you need to do a chmod before starting KDE?
 
Old 07-31-2005, 04:27 AM   #3
nglbrkr
Member
 
Registered: May 2005
Location: hiroshima
Distribution: debian
Posts: 75
Blog Entries: 9

Rep: Reputation: 17
could you amplify where hdparm should go on the startup scripts?

I have a related problem with a script I need to run to get my touchpad to work. If I try to get Gnome to execute it on login, I get a permission denied error. I need to put it somehwere where scripts are executed as root. Where would that be?

Thanks

nigel
 
Old 07-31-2005, 04:40 AM   #4
nglbrkr
Member
 
Registered: May 2005
Location: hiroshima
Distribution: debian
Posts: 75
Blog Entries: 9

Rep: Reputation: 17
ok I found out

I made a link to it in /etc/rcS.d and I put S80 in front of the link name, since all the others followed that patter.

this is on debian
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get root privilege in a script jpan Linux - General 5 01-07-2005 02:46 PM
Temp root privilege in program? ZX_SA Programming 1 07-22-2004 08:14 AM
Root can execute programs lawrencegoodman Linux - Newbie 11 01-28-2004 07:42 AM
some kde applications not execute in RHL 7.2 on login as root chinmay nautiya Linux - Software 5 01-18-2003 06:35 AM
How to get root privilege in program using c? whepin Programming 1 04-06-2002 05:27 AM


All times are GMT -5. The time now is 10:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration