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

From: Adèlphe Rafanambinana <[email-masked]>
Date: Sat, 15 Oct 2011 16:23:03 +0300

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

---

From: Adèlphe Rafanambinana <[email-masked]>
Date: Sat, 15 Oct 2011 18:24:34 +0300

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

-- 
Adèlphe Rafanambinana

---

From: Jeremy Thomerson <[email-masked]>
Date: Sat, 15 Oct 2011 12:09:32 -0400

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" <[email-masked]>
wrote:

Hi all,

On Sat, Oct 15, 2011 at 16:23, Adèlphe Rafanambinana <[email-masked]>
wrote:
> I'...
-- 
Adèlphe Rafanambinana

---

From: Adèlphe Rafanambinana <[email-masked]>
Date: Sat, 15 Oct 2011 19:32:29 +0300

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
<[email-masked]>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

-- 
arafanam

---

From: Jeremy Thomerson <[email-masked]>
Date: Sat, 15 Oct 2011 12:40:38 -0400

Awesome writeup, thanks!

Jeremy Thomerson

On Oct 15, 2011 12:32 PM, "Adèlphe Rafanambinana" <[email-masked]>
wrote:

What I did:

Thank you,

On Sat, Oct 15, 2011 at 19:09, Jeremy Thomerson <[email-masked]>
wrote:
> It would b...
-- 
arafanam