|
From: <da...@ix...> - 2003-08-13 17:38:05
|
In article <DD6...@in...>,
Max Stolyarov <wra...@li...> wrote:
>* Move to directory -> /etc/init.d
>* Create file -> mywrapper (see attached file)
>* Mywrapper file should have content that can be used by Linux
>utility: chkconfig
>* Run command: chkconfig -level 2345 mywrapper on. This will enable
>your application to start at boot time.
As a comment: I'm not sure if all Linux distributions use chkconfig.
Certainly the line doesn't hurt in the init script, but not all systems
will be able to make use of it.
>The only problem I see with running application using wrapper at boot time,
>is that if you have any UI to display to the user, your application will
>crash because X-Windows environment has not being loaded yet. It will only
>be loaded at the time of user login
If that's the case, then the application should be broken up into two
pieces. A server piece that you can launch on boot, and a GUI piece that
somehow talks to the server, that starts up on demand.
>2. Starting wrapper at login
>That's pretty much it. If you determine that there is a better way to do it
>please let me know. The downfall of the second approach is that it will only
>work for a specific user, because .bash_profile script is user specific;
>another user will not have access to it, because it will have its own.
See /etc/profile and /etc/csh.login for running things upon login for all
users. You can even do fancy stuff like basing it upon groups, not running
it if user is root, and so on.
Of course, if it's a GUI app, that may not always work, so check for
existence of DISPLAY envvar. And then throw the app into the local X init
scripts (stuff ran by startx if booting to a console and manually starting
X, for example, or any of the files used by the various graphical login
approaches).
But those are all approaches that can be mostly shared between users.
mrc
--
Mike Castle da...@ix... www.netcom.com/~dalgoda/
We are all of us living in the shadow of Manhattan. -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc
|