running application at boot

Howdy!

I’ve just installed the HotForward .jar, which is a simple email forwarding program that runs in the system tray. To start the program from a terminal, I enter:

/usr/local/vegaSTONE/HotForward/hotforward.sh

But how do I get it to start at boot time?

Thanks for your replies!

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Assuming this will run without any kind of GUI you can link to your
script from /etc/init.d and then use Yast to have it run at startup
(Yast: System: System Services (Runlevel): set default runlevels of 3
and 5) or you can manually add it with ‘chkconfig <yourScriptfileName> on’.

There is quite a bit of other information online on how to setup
services in Linux and basically it boils down to something executable in
/etc/init.d and something linking to it in
/etc/init.d/rc<runlevelNumber>.d with S at the beginning (to start) and
‘K’ at the beginning (to kill/stop).

Good luck.

Slipstream00 wrote:
| Howdy!
|
| I’ve just installed the HotForward .jar, which is a simple email
| forwarding program that runs in the system tray. To start the program
| from a terminal, I enter:
|
| /usr/local/vegaSTONE/HotForward/hotforward.sh
|
| But how do I get it to start at boot time?
|
| Thanks for your replies!
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIfsqb3s42bA80+9kRAoKRAJ9BpYth0dc01c28WISp1IuatsEuAQCeOK3f
JPM/srxUksPJ6+Zi1xfLOlw=
=YHRd
-----END PGP SIGNATURE-----

Thanks for your reply…

(Yast: System: System Services (Runlevel): set default runlevels of 3
and 5) or you can manually add it with ‘chkconfig <yourScriptfileName> on’.

I haven’t tried chkconfig yet, but I found a post on using softlinks.
Wine application starting at boot - openSUSE Forums

I put one in rc3 and rc5. However, the application doesn’t appear in the system tray at boot, but it appears after I open System Services (Runlevel) dialog and select the new HotForward service–I don’t even need to Enable it, just selecting it seems to trigger the process.

My System Services (Runlevel) dialog doesn’t seem to have any functionality for adding services. Only Enable and Disable. There is ??? in the ‘enabled’ column, instead of a definitive ‘yes’ or ‘no’ like in the others.

/etc/init.d and something linking to it in
/etc/init.d/rc<runlevelNumber>.d with S at the beginning (to start) and
‘K’ at the beginning (to kill/stop).

Ok, maybe that’s the problem. But where does the S and K go?

Thread moved to Install/Boot/Login
opensuse.org.help.install-boot-login

Yeah, I’ve googled the whole opensuse.org site and found nothing about adding system services. How bogus is that? :confused:

Yeah, I’ve googled the whole opensuse.org site and found nothing about adding system services and starting at boot. How bogus is that? :confused:

Do you want it at boot time or just to start when your desktop does?

I know that if you are using kde you do that by creating a symbolic link in the /home/kde/autostart folder. To do that run in a terminal:

ln -s /usr/local/vegaSTONE/HotForward/hotforward.sh ~/.kde/Autostart/hotforward

P.S. For KDE4 the folder is .kde4

I’m not sure how to do it in gnome but I think there is a control centre application for adding autostart programs?

Hope that helps

You can start it very easily at bootup, just add the terminal line you use to start the program in the file /etc/rc.d/boot.local

Whatever you put in this file is executed right after the kernel initialization and just before entering runlevel 1.

I use the same file to change some settings to my TT1 console and to put graphical splash screens to all my terminals from 1 to 6 depending on the resolution by simply calling another terminal script.

LRE and dunnfamily, thanks for the replies! I didn’t know about the kde start folder or boot.local. That’s good info.

However, now that I think about it some more, using boot.local might launch it too soon since I wouldn’t want it running in run level 1.

I’d probably want the application to start in run level 3. That way, it would launch without kde. What’s the best way to configure it?

Thanks!

> Yeah, I’ve googled the whole opensuse.org site and found nothing about
> adding system services. How bogus is that? :confused:

which system service(s) do you want to run that is(are) not in YaST?

depending on what you want, you can go (in 10.3, i don’t know about 11.0):

YaST > System > System Services

OR

YaST > Network Services > pick from right

AND/OR

YaST > System > etc/sysconfig Editor > USE CARE


DenverD (Linux Counter 282315)
A Texan in Denmark

That is what I’d do. Just link the app to Autostart.

I want hotforward to start automatically in run level 3. Currently, it doesn’t start automatically.

The service is listed in System Services (Runlevel), and looks like this:

Simple mode (Enabled=Yes*)
Expert mode (Running=No) 3, 5

Strangely, when I open the System Services (Runlevel) dialog, the hotforward icon appears in the system tray and the application starts running.

> hotforward

sorry, i’ve never heard of it before…is it something new in 11.0, or
something you added? anyway…

>
> The service is listed in System Services (Runlevel), and looks like
> this:

anyway, since it does appear in your YaST > System > System Services
(Runlevel) > Expert

then you just need to read and follow the directions on left of that
dialog to enable hotforward in the run level(s) you wish, via an X in
the appropriate boxes…then, click Finish…

> Strangely, when I open the System Services (Runlevel) dialog, the
> hotforward icon appears in the system tray and the application starts
> running.

i don’t understand that, at all…but, even then you STILL need to
specifically enable the service at all desired run levels, AND click
finish to have that become part of the appropriate configuration file
for each runlevel…


DenverD (Linux Counter 282315)
A Texan in Denmark

It’s 3rd party software that forwards mail from Hotmail/MSN accounts to other addresses. Works pretty well so far, aside from not starting automatically.

I don’t understand it either :confused: Why would opening the System Services (Runlevel) dialog trigger HotForward to launch? Very strange indeed. :eek:

I’ve tried to Enable the application like you indicated, but it only gives me this:

Simple mode (Enabled=Yes*) The * means that it’s enabled but not running.
Expert mode (Running=No) 3, 5

My setup looks like this…

The file /etc/init.d/hotforward is as follows:
#!/bin/bash
/usr/local/vegaSTONE/HotForward/hotforward.sh

Creating the softlink from /etc/init.d/rc3.d to /etc/init.d is done like this:
ln -s /etc/init.d/hotforward
/etc/init.d/rc3.d/S99hotforward

The created softlink file /etc/init.d/rc3.d/S99hotforward is as follows:
#! /bin/bash
/usr/local/vegaSTONE/HotForward/hotforward.sh

What could be wrong here?

Slipstream00 wrote:

>
> DenverD;1844125 Wrote:
>> > hotforward
>>
>> sorry, i’ve never heard of it before…is it something new in 11.0, or
>> something you added?
>
> It’s 3rd party software that forwards mail from Hotmail/MSN accounts to
> other addresses. Works pretty well so far, aside from not starting
> automatically.
>
> DenverD;1844125 Wrote:
>>
>> > Strangely, when I open the System Services (Runlevel) dialog, the
>> > hotforward icon appears in the system tray and the application
>> starts
>> > running.
>>
>> i don’t understand that, at all…but, even then you STILL need to
>> specifically enable the service at all desired run levels, AND click
>> finish to have that become part of the appropriate configuration file
>> for each runlevel…
>
> I don’t understand it either :confused: Why would opening the System
> Services (Runlevel) dialog trigger HotForward to launch? Very strange
> indeed. :eek:
>
> I’ve tried to Enable the application like you indicated, but it only
> gives me this:
>
> Simple mode (Enabled=Yes*) The * means that it’s enabled but not
> running.
> Expert mode (Running=No) 3, 5
>
>
> My setup looks like this…
>
> The file /etc/init.d/hotforward is as follows:
> #!/bin/bash
> /usr/local/vegaSTONE/HotForward/hotforward.sh
>
> Creating the softlink from /etc/init.d/rc3.d to /etc/init.d is done
> like this:
> ln -s /etc/init.d/hotforward
> /etc/init.d/rc3.d/S99hotforward
>
> The created softlink file /etc/init.d/rc3.d/S99hotforward is as
> follows:
> #! /bin/bash
> /usr/local/vegaSTONE/HotForward/hotforward.sh
>
> What could be wrong here?
>
>

The Runlevels module executes the command “xxx status” to see if each
application is running or not.

Your script doesn’t support “start, stop, status, restart, etc”, it just
starts hotforward.sh. So yes, it’ll start the program whenever you pull up
the runlevel program.

Wouldn’t it be better to periodically run hotforward with a cron entry…
instead of just once when you boot? It would be much more efficient.

Oops, reread your post. It’s a USER level program.

Ah, put a symlink to hotforward.sh into your Autostart folder. That way,
whenever you log in, it’ll run.

Autostart is located in .kde/Autostart

So if you open a console, you’d type:

ln -s /usr/local/vegaSTONE/HotForward/hotforward.sh ~/.kde/Autostart/

log out, then log back in… taaa daaaa!

Hope that helps.


L R Nix
lornix@lornix.com

lornix, thanks for replying…

Ok, that makes perfect sense then. Mystery solved :slight_smile:

Yes, I know about that one. It was mentioned above. But I need it to launch in run level 3, because I’ve got one-machine that won’t use a graphical interface due to insufficient ram and processor speed. I’ll do everything from the command line.

For someone like me who lives in a world of illogic, that’s just too logical! :smiley:

Actually, although a cron job is a valid solution here, it might mean that I have to wait 10- or 15-minutes to get mail after starting the machine–unless I set it to run every minute or something like that.

I’d be an expedient solution for sure, but I’m still hoping there’s a way to start it in run level 3.

Slipstream00 wrote:

>
> lornix, thanks for replying…
>
> lornix;1844729 Wrote:
>>
>> The Runlevels module executes the command “xxx status” to see if each
>> application is running or not.
>>
>> Your script doesn’t support “start, stop, status, restart, etc”, it
>> just
>> starts hotforward.sh. So yes, it’ll start the program whenever you
>> pull up
>> the runlevel program.
>>
>
> Ok, that makes perfect sense then. Mystery solved :slight_smile:
>
>
>
> lornix;1844729 Wrote:
>>
>> Ah, put a symlink to hotforward.sh into your Autostart folder. That
>> way,
>> whenever you log in, it’ll run.
>>
>> Autostart is located in .kde/Autostart
>
> Yes, I know about that one. It was mentioned above. But I need it to
> launch in run level 3, because I’ve got one-machine that won’t use a
> graphical interface due to insufficient ram and processor speed. I’ll
> do everything from the command line.
>
>
>
> lornix;1844729 Wrote:
>> Wouldn’t it be better to periodically run hotforward with a cron
>> entry…
>> instead of just once when you boot? It would be much more efficient.
>
> For someone like me who lives in a world of illogic, that’s just too
> logical! :smiley:
>
> Actually, although a cron job is a valid solution here, it might mean
> that I have to wait 10- or 15-minutes to get mail after starting the
> machine–unless I set it to run every minute or something like that.
>
> I’d be an expedient solution for sure, but I’m still hoping there’s a
> way to start it in run level 3.
>
>

If I understand correctly, this is a background daemon that moves email
around for you. Not a problem.

Creating init.d type files isn’t hard, I usually just grab a small existing
one, and edit it for my own purposes. They already contain the logic to
handle the start, stop, restart, status, and whatnot requests.

Consider your current query: making it start in runlevel 3 and 5… Let’s
try this:

This is a seriously stripped skeleton, there are usually MANY more comments.
Stripped for brevity.

==================================================

#!/bin/sh

BEGIN INIT INFO

Provides: HotForward

Required-Start: $network $named

Should-Start: $network $named

Required-Stop:

Should-Stop:

Default-Start: 3 5

Default-Stop: 0 1 2 6

Short-Description: Starts the amazing hotforward application

Description: Start hotforward to handle email

END INIT INFO

Check for missing binaries (stale symlinks should not happen)

FOO_BIN=/usr/local/vegaSTONE/HotForward/hotforward.sh

test -x $FOO_BIN || { echo “$FOO_BIN not installed”;
if “$1” = “stop” ]; then exit 0;
else exit 5; fi; }

… /etc/rc.status

rc_reset

case “$1” in
start)
echo -n "Starting hotforward "
$FOO_BIN &

Remember status and be verbose

rc_status -v
;;
stop)
echo -n "Shutting down hotforward "
echo “I’m afraid I can’t do that Dave…”
echo “Please teach me how to shut down this service”

Remember status and be verbose

rc_status -v
;;
restart)

Stop the service and regardless of whether it was

running or not, start it again.

$0 stop
$0 start

Remember status and be quiet

rc_status
;;
*)
echo “Usage: $0 {start|stop|restart}”
exit 1
;;
esac
rc_exit

==================================================

The group of comments near the top is the magic to let the runlevel module
do it’s magic.

Save this file as something like ‘hotforwardd’ (d=daemon) in /etc/init.d,
make sure it’s executable (chmod 755 hotforwardd).

Then you can either type

chkconfig -a hotforwardd

to add / enable the daemon service, or use the yast runlevel module.

The script handles the status query too, so runlevel won’t mysteriously
start hotforward.

I didn’t know exactly how to stop your hotforward script, maybe a ‘killall
hotforward.sh’ or something like that. Edit as needed.

The ‘skeleton’ provided at /etc/init.d/skeleton is HUGE, but well commented.
Read the files/scripts in /etc/init.d to learn more. I grabbed a smaller
file and edited it to suit me.

Hope this helps.


L R Nix
lornix@lornix.com