su in rc scripts or startup scripts problem

su in rc scripts or startup scripts problem

Post by paulyi » Sat, 22 Sep 2001 16:06:55



Hello,

/sbin/su -usr1 'touch /export/home/user1/abc'

When the above script added to my rc script the system, the system display
the following error message when it's startup.

Sep 21 12:18:57 su: 'su user1' succeed for root on /dev/console
/dev/fd: Permission denied
Graphics Adapter device /dev/fd is of unknown type
Fatal server error:
InitOutput: Error loading module for /dev/fd
giving up:
/usr/openwin/bin/Xinit : Connection refused
(errno 146):unable to connect to X server
/usr/openwin/bin/Xinit : No such process
(errno 3):server error

But when I remark (#) that script no erro message is displayed.  I'd be
grateful if you can give me some advices.

--
Best Regards,

Paul Yip
----------------------------------------
Multimedia Unit
Information Technology Services Centre
Hong Kong Baptist University
Tel:  34117181
Fax: 27942888
----------------------------------------

 
 
 

su in rc scripts or startup scripts problem

Post by Adrian Davi » Sat, 22 Sep 2001 18:28:00


Quote:> /sbin/su -usr1 'touch /export/home/user1/abc'

> When the above script added to my rc script the system, the system display
> the following error message when it's startup.

maybe try something like:-

su usr1 -c 'touch /export/home/user1/abc'

Regards,
   =Adrian=

 
 
 

su in rc scripts or startup scripts problem

Post by paulyi » Tue, 25 Sep 2001 11:45:26


Hello,

I'm sorry that I've made some typing mistakes yet.
Actually, My script in startup script should be that

/sbin/su -user1 'touch /export/home/user1/abc'

and got the message I mentioned before.  I wonder if I should change back
the user after execute this command!?  In fact, the file can touch
successfully, but some other errors message prompt.



Quote:> Hello,

> /sbin/su -usr1 'touch /export/home/user1/abc'

> When the above script added to my rc script the system, the system display
> the following error message when it's startup.

> Sep 21 12:18:57 su: 'su user1' succeed for root on /dev/console
> /dev/fd: Permission denied
> Graphics Adapter device /dev/fd is of unknown type
> Fatal server error:
> InitOutput: Error loading module for /dev/fd
> giving up:
> /usr/openwin/bin/Xinit : Connection refused
> (errno 146):unable to connect to X server
> /usr/openwin/bin/Xinit : No such process
> (errno 3):server error

> But when I remark (#) that script no erro message is displayed.  I'd be
> grateful if you can give me some advices.

> --
> Best Regards,

> Paul Yip
> ----------------------------------------
> Multimedia Unit
> Information Technology Services Centre
> Hong Kong Baptist University
> Tel:  34117181
> Fax: 27942888
> ----------------------------------------

 
 
 

1. su freezes in startup rc scripts

I am having problems.

every time I try to use the su command in an rc.* file, it freezes.  For
example, I recently installed Junkbusters.  In the junkbusters rc script, it
runs the command "su - nobody -c '/usr/sbin/junkbuster
/etc/junkbuster/config' &".  The command freezes sometime after su starts
and sometime before junkbuster finishes.  If I do a ps, I see that the su
command is still running, but junkbuster isn't running.  I have to restart
it after I log in.

Which brings me to my next problem.  I decided to add the following commands
to the end of my rc.local
cd /home/ajo
/bin/su - ajo

Again, the su command freezes.  I am able to get out of it with a ^D.

Anyone have any ideas?

                                jay

--
"The movie really heightens the lack of interest in the film"
                                    --Crow T. Robot

http://www.bigfoot.com/~aonifer/       PGP key on WWW page

2. procps 3.0.1

3. Script to create startup scripts in /etc/init.d or /etc/rc?.d

4. Support for intel 815 chipset

5. su to a user then su to root in startup script

6. Ext2fs Info

7. RC startup script problem...

8. upgrading 2.2.7 to 2.2.8 by FTP

9. su in rc script!

10. startup script rc.local !

11. rc vs. init.d style startup scripts

12. Startup Script in /etc/rc.d/rc3.d Doesn't Seem to Work.

13. Scripts in /usr/local/etc/rc.d wont execute at startup