[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Simplest way to have a shell script run at startup?



Correction:  Upon checking, it appears that when I reboot the live ISO, it is running my script that's in the /lib/live/config directory.




From: o haya <ohaya@yahoo.com>
To: o haya <ohaya@yahoo.com>; chals <chals@chalsattack.com>; "debian-live@lists.debian.org" <debian-live@lists.debian.org>
Sent: Sunday, August 30, 2015 4:25 PM
Subject: Re: Simplest way to have a shell script run at startup?

Hi,

Sorry for the confusion, but I think I understand SOME of how this is supposed to work.

The /etc/live-config executes /lib/live/config.sh.

Then, the /lib/live/config.sh apparently (I think) is supposed to parse and execute the files in the /lib/live/config directory.

I have my test shell script in the /lib/live/config directory but I don't know why it doesn't seem to be being executed upon boot :(...

Jim





From: o haya <ohaya@yahoo.com>
To: o haya <ohaya@yahoo.com>; chals <chals@chalsattack.com>; "debian-live@lists.debian.org" <debian-live@lists.debian.org>
Sent: Sunday, August 30, 2015 4:08 PM
Subject: Re: Simplest way to have a shell script run at startup?

Now I am confused.  

I was checking /etc/init.d on the live system, and there is a "live-config" file there, which looks like it basically checks for, and then runs /lib/live/config.sh?

In other words, it looks like rather than running the executables/scripts that are IN /lib/live/config, it is running the ONE script, /lib/live/config.SH?

Thanks,
Jim




From: o haya <ohaya@yahoo.com>
To: o haya <ohaya@yahoo.com>; chals <chals@chalsattack.com>; "debian-live@lists.debian.org" <debian-live@lists.debian.org>
Sent: Sunday, August 30, 2015 2:01 PM
Subject: Re: Simplest way to have a shell script run at startup?

Hi,

I found the 1190-runclean in /lib/live/config after booting the ISO, and I now have that to write a line to /var/log/messages, which I assume should be ok.

However, after booting the system, I don't see that line in /var/log/messages, i.e., the 1190-runclean does not seem to be executing during the boot.

I've confirmed that the 1190-runclean has execute privs.

What else do I need to do to get it to run at boot?

Thanks,
Jim




From: o haya <ohaya@yahoo.com>
To: chals <chals@chalsattack.com>; "debian-live@lists.debian.org" <debian-live@lists.debian.org>
Sent: Sunday, August 30, 2015 1:43 PM
Subject: Re: Simplest way to have a shell script run at startup?

Hi,

I tried that, with a script that just writes a file to /tmp, but after booting, the file doesn't exist in /tmp.

Should the script be able to write a file to /tmp?  And should the file persist?

Also, would the 1190-runclean file itself persist somewhere after booting?  It's not in /etc/init.d or anywhere that I can find.

Thanks!

Jim




From: chals <chals@chalsattack.com>
To: "debian-live@lists.debian.org" <debian-live@lists.debian.org>
Cc: o haya <ohaya@yahoo.com>
Sent: Sunday, August 30, 2015 9:47 AM
Subject: Re: Simplest way to have a shell script run at startup?

On Sun, Aug 30, 2015 at 3:05 PM, o haya <ohaya@yahoo.com> wrote:
>
> So do I just include an executable script with a number in the file name
> like:
>
> 1190-runclean
>
> in the config/lib/live directory, where the 1190-runclean runs my shell
> script and then do the build?
>

The correct directory is (as explained in the documentation I linked
to previously):

config/includes.chroot/lib/live/config/

And you can make your 1190-runclean hook run a script i.e a script
running a script, or even better, include the commands to be executed
in your hook (depending on what you want to achieve).





--
chals
www.chalsattack.com
chals@chalsattack.com












Reply to: