Hello List, I want to boot into single user mode and run a script automatically. I have been looking for a couple of hours and have found one solution I don't like. How can I get the shell that is started in single user mode to run a script. My one solution was to add a profile in /etc/profile.d/ that called the script. Is this the only way to do it? Thanks, -- Stephen Clark *NetWolves* Director of Technology Phone: 813-579-3200 Fax: 813-882-0209 Email: steve.clark at netwolves.com http://www.netwolves.com
On Tue, Feb 04, 2014 at 03:04:05PM -0500, Steve Clark wrote:> Hello List, > > I want to boot into single user mode and run a script automatically. > > I have been looking for a couple of hours and have found one solution I don't like. > > How can I get the shell that is started in single user mode to run a script. My one solution > was to add a profile in /etc/profile.d/ that called the script. Is this the only way to do it? >wild guess here: 1. make this a username that isn't used for any other purpose 2. try setting the default shell in /etc/password, for that user, to run the script. This may require some experimentation to find the correct incantation. no clue if it'll work, haven't tried it. good luck! -- ---- Fred Smith -- fredex at fcshome.stoneham.ma.us ----------------------------- "For him who is able to keep you from falling and to present you before his glorious presence without fault and with great joy--to the only God our Savior be glory, majesty, power and authority, through Jesus Christ our Lord, before all ages, now and forevermore! Amen." ----------------------------- Jude 1:24,25 (niv) -----------------------------
Steve Clark wrote:> Hello List, > > I want to boot into single user mode and run a script automatically.<snip> How often - every time, or just once? If every time, create a script and put it in /etc/init.d/, with a link to /etc/rc1.d, or use whatever it is in systemd's analog. mark
On Tue, Feb 4, 2014 at 2:04 PM, Steve Clark <sclark at netwolves.com> wrote:> Hello List, > > I want to boot into single user mode and run a script automatically. > > I have been looking for a couple of hours and have found one solution I don't like. > > How can I get the shell that is started in single user mode to run a script. My one solution > was to add a profile in /etc/profile.d/ that called the script. Is this the only way to do it?What is the big picture here? You could probably just stick your script into /etc/rc.d/rc.local where it will run at the end of the other runlevel processing - and have it put back the old version if it only needs to run once. But, poking through /etc/init/* it looks like a file named /etc/init/rcS-sulogin.override would do something magic like you want. -- Les Mikesell lesmikesell at gmail.com