~alpine/devel

4 2

[alpine-devel] How to run script at startup

Adèlphe Rafanambinana <radelphe@gmail.com>
Details
Message ID
<CAF-+OzABh_NPrTZ2oMFUKrsYmSE5obOadKTAth1HU5_OEZUxPQ@mail.gmail.com>
Sender timestamp
1318684983
DKIM signature
missing
Download raw message
Hi all,

I'd like to run one program at startup. Then I put the command into a bash
script:

#!/bin/bash
/usr/bin/screen -dmS <session_name> </path/to/command>

I create a "rc.local" file and put it to /etc (I tried to put it to
/et/init.d/rc.local too)
When I run it mannually, it works well but it wouldn't start at next boot.

Anyone can help me to get it working?

Thank you,
-- 
Adèlphe Rafanambinana

Re: [alpine-devel] Re: How to run script at startup

Jeremy Thomerson <jeremy@thomersonfamily.com>
Details
Message ID
<CADVmKVAxaEEcK+pcD=GAEYw3-O9kzYmQJLZK5cXjcPcp0k5HMA@mail.gmail.com>
In-Reply-To
<CAF-+OzDwsLQk=65D1HD78gBjowhTPWrEWs4_Rj2MS_jOhWWU0Q@mail.gmail.com> (view parent)
Sender timestamp
1318694972
DKIM signature
missing
Download raw message
It would be great if you could post your answer here so others searching the
list in the future can find it.

Jeremy Thomerson
-- sent from my "smart" phone, so please excuse spelling, formatting, or
compiler errors

On Oct 15, 2011 11:25 AM, "Adèlphe Rafanambinana" <radelphe@gmail.com>
wrote:

Hi all,
Just to let you know, that I get my answer and it works well.
Thank you,


On Sat, Oct 15, 2011 at 16:23, Adèlphe Rafanambinana <radelphe@gmail.com>
wrote:
>
> Hi all,
>
> I'...
-- 
Adèlphe Rafanambinana

Re: [alpine-devel] Re: How to run script at startup

Jeremy Thomerson <jeremy@thomersonfamily.com>
Details
Message ID
<CADVmKVC=1hrOBDAC7xf2xvJbES_9m6wz3Ogr+dbVC4acv+CJUw@mail.gmail.com>
In-Reply-To
<CAF-+OzAL+aRe812v000UEvpH=A7T6p4ONw=LYiOgdtjq45H+ag@mail.gmail.com> (view parent)
Sender timestamp
1318696838
DKIM signature
missing
Download raw message
Awesome writeup, thanks!

Jeremy Thomerson
-- sent from my "smart" phone, so please excuse spelling, formatting, or
compiler errors

On Oct 15, 2011 12:32 PM, "Adèlphe Rafanambinana" <radelphe@gmail.com>
wrote:

After doing some search in Internet, I found that OpenRC/baselayout2 changed
the way how to run a script/program as local service during startup.

local service is part of the predefined service in default runlevel. It is
responsible for handling the scripts defined in /etc/local.d. The scripts,
with suffix .start or .stop, are executed in lexical order (during start or
stop of the system, depending on the suffix).
That means * /etc/local.d/* is the proper place to put scripts ending with
.start that you want executed during the boot.

What I did:

1. move my script to /etc/local.d
2. rename it to my_script*.start
*3. add local service to start automatically by running the following
command:
  rc-update add local default
4. reboot the machine, and it works.

Thank you,



On Sat, Oct 15, 2011 at 19:09, Jeremy Thomerson <jeremy@thomersonfamily.com>
wrote:
>
> It would b...
-- 
arafanam

[alpine-devel] Re: How to run script at startup

Adèlphe Rafanambinana <radelphe@gmail.com>
Details
Message ID
<CAF-+OzDwsLQk=65D1HD78gBjowhTPWrEWs4_Rj2MS_jOhWWU0Q@mail.gmail.com>
In-Reply-To
<CAF-+OzABh_NPrTZ2oMFUKrsYmSE5obOadKTAth1HU5_OEZUxPQ@mail.gmail.com> (view parent)
Sender timestamp
1318692274
DKIM signature
missing
Download raw message
Hi all,
Just to let you know, that I get my answer and it works well.
Thank you,

On Sat, Oct 15, 2011 at 16:23, Adèlphe Rafanambinana <radelphe@gmail.com>wrote:

> Hi all,
>
> I'd like to run one program at startup. Then I put the command into a bash
> script:
>
> #!/bin/bash
> /usr/bin/screen -dmS <session_name> </path/to/command>
>
> I create a "rc.local" file and put it to /etc (I tried to put it to
> /et/init.d/rc.local too)
> When I run it mannually, it works well but it wouldn't start at next boot.
>
> Anyone can help me to get it working?
>
> Thank you,
> --
> Adèlphe Rafanambinana
>
>
>


-- 
Adèlphe Rafanambinana

Re: [alpine-devel] Re: How to run script at startup

Adèlphe Rafanambinana <radelphe@gmail.com>
Details
Message ID
<CAF-+OzAL+aRe812v000UEvpH=A7T6p4ONw=LYiOgdtjq45H+ag@mail.gmail.com>
In-Reply-To
<CADVmKVAxaEEcK+pcD=GAEYw3-O9kzYmQJLZK5cXjcPcp0k5HMA@mail.gmail.com> (view parent)
Sender timestamp
1318696349
DKIM signature
missing
Download raw message
After doing some search in Internet, I found that OpenRC/baselayout2 changed
the way how to run a script/program as local service during startup.

local service is part of the predefined service in default runlevel. It is
responsible for handling the scripts defined in /etc/local.d. The scripts,
with suffix .start or .stop, are executed in lexical order (during start or
stop of the system, depending on the suffix).
That means * /etc/local.d/* is the proper place to put scripts ending with
.start that you want executed during the boot.

What I did:

1. move my script to /etc/local.d
2. rename it to my_script*.start
*3. add local service to start automatically by running the following
command:
  rc-update add local default
4. reboot the machine, and it works.

Thank you,

On Sat, Oct 15, 2011 at 19:09, Jeremy Thomerson
<jeremy@thomersonfamily.com>wrote:

> It would be great if you could post your answer here so others searching
> the list in the future can find it.
>
> Jeremy Thomerson
> -- sent from my "smart" phone, so please excuse spelling, formatting, or
> compiler errors
>
> On Oct 15, 2011 11:25 AM, "Adèlphe Rafanambinana" <radelphe@gmail.com>
> wrote:
>
> Hi all,
> Just to let you know, that I get my answer and it works well.
> Thank you,
>
>
> On Sat, Oct 15, 2011 at 16:23, Adèlphe Rafanambinana <radelphe@gmail.com>
> wrote:
> >
> > Hi all,
> >
> > I'...
>
> --
> Adèlphe Rafanambinana
>
>
>


-- 
arafanam
Reply to thread Export thread (mbox)