run script as a user(ex: user1) at boot time

I created a sym link to my shell script, to run while machine
restarts. But I need run my script as a normal user. But calling my
shell script through sysm link is making it run as root.
How can run my script as a user(ex: user1) while boot time/in
restarts.

Thanks
RGiripragada
linux [ Fr, 25 Januar 2008 10:43 ] [ ID #1915902 ]

Re: run script as a user(ex: user1) at boot time

On 2008-01-25, linux <rgiripragada [at] gmail.com> wrote:
>
>
> I created a sym link to my shell script, to run while machine
> restarts. But I need run my script as a normal user. But calling my
> shell script through sysm link is making it run as root.
> How can run my script as a user(ex: user1) while boot time/in
> restarts.
>
Use su or sudo or run it from /etc/crontab.
Bill Marcum [ Fr, 25 Januar 2008 13:28 ] [ ID #1915910 ]

Re: run script as a user(ex: user1) at boot time

On 2008-01-25, linux <rgiripragada [at] gmail.com> wrote:
> I created a sym link to my shell script, to run while machine
> restarts. But I need run my script as a normal user. But calling my
> shell script through sysm link is making it run as root.
> How can run my script as a user(ex: user1) while boot time/in
> restarts.

Edit your cron jobs with:
crontab -e

.... and add the following line:
[at] reboot /home/myUser/MyScript

At each reboot, the script will run under your name.


--
There is an art, it says, or rather, a knack to flying.
The knack lies in learning how to throw yourself at the ground and miss.
Douglas Adams
Rikishi 42 [ Sa, 26 Januar 2008 21:16 ] [ ID #1916703 ]
Linux » comp.unix.shell » run script as a user(ex: user1) at boot time

Vorheriges Thema: Run and kill program after specific time
Nächstes Thema: Re: uniq without sort <-------------- GURU NEEDED