Link to home
Start Free TrialLog in
Avatar of Luxana
LuxanaFlag for Australia

asked on

startx as a user

Hello,

I'm running really simple installation of debian. There are no KDM or GDM.  xserver is running properly. What I would like to do is to start X as a user foobar and then once X running automatically start perl script myapplication.pl as a user root. What I have tried is:

chmod +s myapplication.pl -  this would not work

any hints?

thank you
Avatar of Gabriel Orozco
Gabriel Orozco
Flag of Mexico image

use sudo to run scripts as root

do shell script "echo password | sudo -S command"

or

do shell script "sudo -S command <password.txt"
Avatar of Luxana

ASKER

where would you put perl script?
replace "command" with your perl script name

just be sure your perl script has the shebang line referencing perl executable

#!/usr/bin/perl  (if perl is in there)
SOLUTION
Avatar of WizRd-Linux
WizRd-Linux
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Luxana

ASKER

Hi WizRd-Linux,

but if I put it in /usr/bin it does not get executed after user starts startx

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial