executing command at boot

Hi there,

im searching for this answer now a pretty long time and i know that many similar questions where asked and i all looked them up but they didnt help me.
Im trying to run a the command “vncserver” on our opensuse11.2 server when its booted.
many posts here endet in “put a sh script into your /kde4/Autostart” but that didtn help for me because the server runs without a screen and normally nobody is logged in. When i logged in that worked fine.
i also tried to add the command “vncserver” to "/etc/init.d/boot.local " but that didnt work too. i think its to early executed to work.
i also tried to activate the service to start up at boot with chkconfig vncserver start but the service vncserver is “unknown”. when i type vncserver into the console after logging in everything is alright.
you see i really tried a lot and searched a long time at google and in this forum but nothing worked :frowning:
i hope someone here can help me with that

thanks for any tip
blace

Hi
If you don’t need more than two concurrent sessions to the server (as
in GUI), then look at installing NX from nomachine, it’s more secure
(as it uses ssh) and faster than vnc X11 protocol. All you need to do
on the server is enable ssh and open the firewall for the secure shell
server in YaST firewall.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 9 days 15:21, 3 users, load average: 0.12, 0.20, 0.13
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.53

I found that runlevel 5 needs to be reached before vncserver would work.

For my purposes it is OK to enable autologin and then of course I arranged for the command “dbus-launch vncserver” to run, and the result is good. I do allow a screen saver to lock the server but there are obvious security flaws if the server isn’t in a safe location.

If you don’t want to leave the server open with a user logged in, you could try an auto logout after e.g. 1 minute by use of a crontable entry (very inelegant/cumbersome I know, but can’t think of any other way to circuit the need for runlevel 5).

FWIW: TightVNC Server Running as a Service

Have you tried putting in a command at the end of /etc/inittab? Something along the lines of:

ZZ:35:respawn:<command>

where:

ZZ is a unique identifier (check to make sure this is not used elsewhere in inittab),

35 means the command will be run in runlevels 3 and 5 (you may just need 5),

respawn means the command will be re-invoked if it terminates for any reason (good idea?) and

<command> is the command to be run followed by any parameters.

Take a backup of inittab before you change it just in case things go wrong.

thanks all of you for your ideas… i think ill try it with an Auto-Login. Thanks for that