Automatic scrip execution on the console in single user mode on Solaris 10

Hi All,
On Solaris 8, I am able to launch my script automatically on the console when the system comes up into single user mode without having to enter the password. However, on Solaris 10, the script is display in the foreground on the console. When i do a ps -ef , I see the process running. Can someone please tell me how to get this to work on solaris 10?
To automatically boot the system into single user mode:
# svcadm milestone -d milestone/single-user:default
Files edited for this to work on solaris 8:
To login without a password:
# cat > /etc/default/sulogin <<EOF
PASSREQ=NO
CONSOLE=/dev/console
ALTSHELL=YES
EOF
# echo "/sbin/su -" > /sbin/rc1
(Solaris 10, I used rcS instead of rc1)
my script is called from the /.profile when the system comes up into single user mode.
I did the same on solaris 10, but no success.
Please let me know if you have any suggestions.
Thank you,
Brian

try
- add 'set -x' to your /etc/profile
- add 'set -x' to /etc/rc? scripts
- check /etc/vfstab for a nfs mountpoint not using 'bg'

Similar Messages

  • Post install problem. Changes to the state or options of DB SUSDB can't be made at this time. DB Is in single-user mode.

    Hi,
    Have you ever come across this problem before.
    Changes to the state or options of DB SUSDB can't be made at this time. DB Is in single-user mode and a user is currently connected to it.
    It's preventing the post WSUS installation task from completing.
    I opted to use the WID Database option and it created the SUSDB.
    How can I resolve it?
    Thanks  

    this sounds similar to some issues that occurred when KB2720211 was first release (the update does put the DB into single-user mode, to perform some tasks, then switches it back into multi-user mode. sometimes, that switch-back was not performed, and the
    DB was left in single-user mode).
    You can refer to this thread, the steps are buried in there.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/531d576b-eeaf-40dc-9057-b3adbde6186f/kb2720211-debacle-is-this-acceptable-microsoft-quality?forum=winserverwsus
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Unable to start in single-user mode - HD dead?

    My MacBook Pro (Mac OS X) refused to start, it hung up on the loading screen where you see the apple and the spinning loading wheel. I found out how to fix this, I had to go into single-user mode and type "/sbin/fsck -fy" to repair/verify the disk (I was unable to do so from the Disk Utility via the Install Disc, the repair/verify buttons were just grayed out).
    Anyways, doing this from the command line (single-user mode) fixed the problem and I could boot into Mac OS X (there were more issuses after this point which forced me to do an "Archive and Install").
    ^ that happened a week ago. And happened again yesterday, hung up on the exact same point. So I boot up my Mac into single-user mode, and type in "/sbin/fsck -fy" to start the process. Different from last time, I got a lot of text this time. It also kept going for a longer while. After about 10 minutes, there was a couple of minutes where nothing happened. So I typed "/sbin/fsck -fy" again (as I'm supposed to do so until it says "** The volume (nameofvolume) appears to be OK"), and I got some more text, then nothing happened for a while.
    Inpatient as I am, I considered the process to be complete, and restarted my Mac by typing "exit".
    I think I ****** up my Mac OS X partition at this point. Because when I try to start my Mac now, it automaticly boots into Windows XP (my other partition). Also I cannot enter single-user mode or Verbose mode, the Mac just ignores and goes right into Windows XP.
    I've tried to boot from the Install Disc. When I run Disk Utility, the "HD"(name of Mac OS X partition) is grayed out. I can't do an Archive and Install because it cannot detect my main partition.
    An interesting thing though: When I have the Install Disc inserted, I can enter single-user mode (by holding cmd+s at startup). However, when I type /sbin/fsck -fy, it starts verifying the Install Disc rather than the HD.
    Also when I open My Computer in Windows XP, I can see the other partition (MacDrive). When I select it, I see:
    Free Space: 219GB
    Total Size: 168GB
    This indicates that my HD is dead/erased, and that my last three months of work is gone. This just because I'm impatient, and didn't wait for the fsck process to complete.
    What is the next step? How can I get into single-user mode so that I can verify/repair my disc?

    On the point of contacting the folks at Alsoft, I have found that they seem to be unobtainable on www.alsoft.com at present.
    I wanted to get in touch as I had a small problem with Diskwarrior on updating to 10.5.5 from 10.5.4 ,
    Disk permissions ends with an error code.
    I wonder if there were so many queries re this that they are unobtainable?
    I run 3 machines from a wireless router, an iMac, an HP laptop with XP and a totally obsolete Dell into which i have squeezed W2000, with a resultant mix of browsers but no contact with the folks at Alsoft.
    Am I in a minority of one here?

  • Wipe a HD via Unix in Single User Mode?

    Is it possible to wipe a hard drive using diskutil or another method when booting up in Single User Mode? We routinely need to wipe drives and if possible, this would be the easiest.
    I suspect because the OS that boots in Single User Mode is on that same drive will make this impossible.
    Thanks in advance for your tips and comments,
    Doug

    Yes, you cannot erase an OS while it's 'hosting' the erasure. Single user mode is part of Mac OS X, so it's on the hard drive, not in the firmware or anything super-low-level like that. Oh well. So... you might be able to erase the vast majority of user, application, and even OS files, but it won't be complete and won't be 'as good as' a volume-format.
    A couple alternatives come to mind (sorry if you know all this. Not trying to be pedantic or patronizing, just making sure you know your options).
    We keep host computers around just for running wipes, backups, and diagnostics that cannot run from a drive holding the booted OS. You simply restart the to-be-wiped Mac holding the 't' key, connect it via firewire, and treat it as an external hard drive.
    You could also just boot from a Mac OS X install disc and wipe from the copy of Disk Utility included on the disc. Better yet, throw a +bona fide+ copy of OS X onto a pocket hard drive, boot the victim-Mac from that (hold option while it is first starting up), and wipe the internal HD normally, now that it's not in use. You could maybe even use single user mode in the booting OS, like you'd imagined, and format from there (I'm not sure that would be faster than letting it boot normally, though, as you might have to use "dd" or some other similar low-level wipe method, as I don't think the frameworks required for Apple's cli "diskutil" are available in single user mode).
    I haven't tried to use it on a Mac, but I have a 256 MB USB flash drive with, er, ['Darn' Small Linux|http://tinyurl.com/5md7t] on it for diagnosing Windows boxes. It runs a script on boot which, if you don't intervene to run utilities or what-have-you, will wipe all attached hard drives and shut down. I keep it locked up for understandable reasons, but its super useful just as a time-saver, booting most machines and beginning the countdown-to-wipe in under ten seconds.
    Anyway, let us know what your goals and thoughts are.
    Cheers, Joel

  • Single-User Mode Copying Files/System Does not Boot Past Apple Logo Screen

    I have a Macbook 2.0GHZ, 2GB RAM, that recently tried to download a secuirty and keynot update. Following the download the system will no longer boot past the Apple Logo Screen with the spinning wheel. I do not have access to a OS disk yet or to a firewire cable either. I've have seen posts from others that describe how to use traget disk mode to reinstall the secuirty update manually and then they can boot their computer. Safe mode will not work. I did boot into single-user mode and run the disk utility there and it says my HD is OK. Since I do not have a firewire or an OS Disk, I am wondering if there is a way to copy those files i need to a USB pen stick then install them onto the computer via single-user mode, considering this is the only way I can boot and manipulate the machine at this time. If this is not possible please let me know so I can find a way to scrounge up a firewire cable or disk. Thank you in advance for any assistance.
    Ted K

    Thanks to Limnos and BDAqua I know you guys have helped others with these kind of problems from the other posts I read. I just want to list what I did exactly in case anyone wants to try to do this with a usb drive or does not have access to a boot disk or firewire cable.
    1: Install security update on a pen drive
    2: Boot in single user mode, CMD-S on startup
    3: /sbin/mount -uw /
    4: mkdir /Volumes/usb (usb can be any name, name of usb drive or anything you want)
    5: ls /dev (you need to get the drive listing for the usb drive to mount it appropriately, it should be disk#s# but this is close to what the HD and Cd drives are listed as so you may need to list once before you put the usb stick in and once ater. I had issues inserting the usb drive in single-user mode and it would freeze up the root drive)
    6: /sbin/mount_msdos /dev/disk1s1 /Volumes/usb (this mounts the usb drive, i had to use msdos because of how my usb drive was formatted, you may need to check your usb drive format, hfs is the apple format for usb drives but it did not work for me)
    7: cp /Volumes/usb/SecUpd2009-001Intel.dmg (this copies the files from the usb drive to the root drivel, at this point you no longer need the usb drive)
    8: hdiutil mount /SecUpd2009-001Intel.dmg (this mounts the disk image)
    9: cd /Volumes/"Security Update 2009-001" (after i mounted the image this is how it appeared in the Volumes directory, you might need to do ls /Volumes to get the name, the quotes are important to get the whole file directory changed)
    10: installer -pkg SecUpd2009-001Intel.pkg -target / (this installs the acutal update, i used the SecUpd2009-001Intel.pkg and it worked though I think you might be able to use "Security Update 2009-001" with quotes as well.)
    11: reboot
    i hope this helps anyone looking to do this. Thanks again to those who helpes and all the other posts that had information that helped me identify and then fix my issue! I still love my mac.

  • Single user mode session lost after backgound processes jump in

    We have an application running on SQL server. This application restores DB very frequently using Single user mode. Following are the SQLs that are executed to restore the database in single user mode and to get the database back in multi user mode.
    alter database [test-db] set single_user with rollback immediate; --This sql is run using test-db
    use master;restore database [test-db] from database_snapshot = 'snapshot_test-db';
    alter database [test-db] set multi_user;
    After switching the test-db to single user mode some 4-5 background processes of Taskmanager jump in for the test-db kicking off the session that application has taken over in single user mode . These background process are deadlocked between them selves.
    Please refer to the output of sp_who2 below at link.
    http://social.microsoft.com/Forums/getfile/200625
    and following is the deadlock XML.
    NOTE: SPIDs in deadlock XML may differ from the output of sp_who2 as spids keeps on changing for these processes.
    <deadlock-list>
    <deadlock victim="process4bbfc78">
    <process-list>
    <process id="process4bbfc78" taskpriority="0" logused="10000" waitresource="DATABASE: 5 " waittime="705" schedulerid="1" kpid="1648" status="background" spid="22" sbid="0" ecid="0" priority="0" trancount="0">
    <executionStack/>
    <inputbuf>
    </inputbuf>
    </process>
    <process id="process6d44388" taskpriority="0" logused="10000" waitresource="DATABASE: 5 " waittime="419" schedulerid="1" kpid="5796" status="background" spid="30" sbid="0" ecid="0" priority="0" trancount="0">
    <executionStack/>
    <inputbuf>
    </inputbuf>
    </process>
    <process id="process6d44718" taskpriority="0" logused="10000" waitresource="DATABASE: 5 " waittime="109" schedulerid="1" kpid="3908" status="background" spid="16" sbid="0" ecid="0" priority="0" trancount="0">
    <executionStack/>
    <inputbuf>
    </inputbuf>
    </process>
    <process id="process4bbee38" taskpriority="0" logused="10000" waitresource="DATABASE: 5 " waittime="313" schedulerid="1" kpid="2656" status="background" spid="15" sbid="0" ecid="0" priority="0" trancount="0">
    <executionStack/>
    <inputbuf>
    </inputbuf>
    </process>
    </process-list>
    <resource-list>
    <databaselock subresource="FULL" dbid="5" dbname="unknown" id="lock4671600" mode="S">
    <owner-list>
    <owner id="process6d44718" mode="S"/>
    <owner id="process4bbee38" mode="S"/>
    </owner-list>
    <waiter-list>
    <waiter id="process4bbfc78" mode="X" requestType="wait"/>
    </waiter-list>
    </databaselock>
    <databaselock subresource="FULL" dbid="5" dbname="unknown" id="lock4671600" mode="S">
    <owner-list>
    <owner id="process4bbfc78" mode="S"/>
    </owner-list>
    <waiter-list>
    <waiter id="process6d44388" mode="X" requestType="wait"/>
    </waiter-list>
    </databaselock>
    <databaselock subresource="FULL" dbid="5" dbname="unknown" id="lock4671600" mode="S">
    <owner-list>
    <owner id="process4bbfc78" mode="S"/>
    </owner-list>
    <waiter-list>
    <waiter id="process6d44718" mode="X" requestType="wait"/>
    </waiter-list>
    </databaselock>
    <databaselock subresource="FULL" dbid="5" dbname="unknown" id="lock4671600" mode="S">
    <owner-list>
    <owner id="process4bbfc78" mode="S"/>
    </owner-list>
    <waiter-list>
    <waiter id="process4bbee38" mode="X" requestType="wait"/>
    </waiter-list>
    </databaselock>
    </resource-list>
    </deadlock>
    </deadlock-list>
    On searching for this problem I found out that people have faced similar problem but I was unable to find out the root cause and debug steps for this problem. Stopping the SQL server is provided as a solution to kick out these background processes but this
    is not a feasible in our case as code to restore DB runs very frequently resulting in this problem at a good frequency.
    I also made sure that SQL Server Agent is not running. The SQL services running on server are SQL server, SQL Server Browser and SQL Server VSS Writer.
    Any help will be appreciated as this is a blocker problem.
    Thanks,

    Hi Amrita,
    We can open a transaction, make data modifications to generate a lot of transaction log, and then run ALTER DATABASE AppDB SET MULTI_USER in the same transaction. You can also refer to the following document:
    Getting out of single user mode:
    http://blogs.msdn.com/b/dfurman/archive/2012/01/20/getting-out-of-single-user-mode.aspx
    Allen Li
    TechNet Community Support

  • Single User Mode Question

    I use single user mode to do fsck because doing it on a live disk takes way too long. I was wondering if there is a way to repair permissions from single user mode. Thanks

    1. what does AFAIK mean?
    As Far As I Know
    2. What I have gathered is that it is near next to y difficult to repair permission fro the CLI and single user mode.
    Correct. You can't use diskutil because the disk framework isn't loaded. You can do it if you're booted from an install DVD, though.

  • How to eject DVD in single user mode

    Hi All,
    When starting my iMac, I get a white screen, the apple logo and the spinning wheel. After a while it goes away and I have just a white screen.
    I've reset PRAM, to no avail (it did do something, the computer start up sound now occurs each restart).
    I can't start-up on the Mac OS install DVD because I have a DVD in the computer already and I can't seem to eject it.
    I can't get into Open Firmware mode to eject the disk there, I'm hoping someone can give me the command to eject the disc from Single-User mode.
    Chris

    Try the methods listed in this page:
    http://reviews.cnet.com/8301-13727_7-10333570-263.html
    The method for Terminal may also work in single-user mode.

  • Difference between emergency state and single user mode ?

    Hi,
    I want to know the difference between emergency state which we normally use in suspect mode database and single user mode.
    Navakanth

    Emergency/suspect mode is tells you the state of the database and database is not available for user action but where as single user mode tells the user action preference. Database is active and available for the user action.
    You can refer 
    http://msdn.microsoft.com/en-us/library/bb522682.aspx
    EMERGENCY
    The database is marked READ_ONLY, logging is disabled, and access is limited to members of the sysadmin fixed server role. EMERGENCY is primarily used for troubleshooting purposes. For example, a database marked as suspect due to a corrupted log file can be
    set to the EMERGENCY state. This could enable the system administrator read-only access to the database. Only members of the sysadmin fixed server role can set a database to the EMERGENCY state.
    SINGLE_USER
    Specifies that only one user at a time can access the database. If SINGLE_USER is specified and there are other users connected to the database the ALTER DATABASE statement will be blocked until all users disconnect from the specified database. To override
    this behavior, see the WITH <termination> clause.
    The database remains in SINGLE_USER mode even if the user that set the option logs off. At that point, a different user, but only one, can connect to the database.
    Before you set the database to SINGLE_USER, verify the AUTO_UPDATE_STATISTICS_ASYNC option is set to OFF. When set to ON, the background thread used to update statistics takes a connection against the database, and you will be unable to access the database
    in single-user mode. To view the status of this option, query the is_auto_update_stats_async_on column in the sys.databases catalog view.
    If the option is set to ON, perform the following tasks:
    Set AUTO_UPDATE_STATISTICS_ASYNC to OFF.
    Check for active asynchronous statistics jobs by querying the sys.dm_exec_background_job_queue dynamic management view.
    If there are active jobs, either allow the jobs to complete or manually terminate them by using KILL STATS JOB.
    --Prashanth

  • Why won't single user mode recognize /sbin/mount command?

    I need help from people who are knowledgable abou these Mac wonders of the world and single user mode.
    I'm trying for the life of me to run "memtest" in single user mode and am finding it impossible.
    After I boot into single user mode, I get a "Shell>" prompt.
    I type in /sbin/fsck/ -y to do some check thing.  I then type in /sbin/mount -uw /
    Both times I get an error saying that "/sbin/yada yada yada  is not recognized as an internal or external command, batch or whatever"
    No command work at all.  I have no clue what I'm doing and am using instructions from where I got the memtest app.  Sure I could just run it from the Terminal but then you're not testing all of the RAM, only the available portion.  There's a huge chunck that won't be tested as OSX is using it.  I want to do this as I just upgraded RAM to 8G with Crucial and now my MBP is acting very slow and weird.
    HELP????  Why does this have to be sooooo hard.

    I found the solution to the problem.  Somone on a different forum had the same issue at one time.  The problem is my use of Refit.  When you hold Command-S at start when using refit you go into a single user type mode inside the refit shell.  So it is something different.
    Instead I needed to let the Mac boot Refit like normal.  With the Mac partition highlighted press "F2" and it will display boot options for the Mac partition.  One of them is Mac OSX single user mode.  Simply select and hit enter and then I enter the correct single user mode and I'm off.
    Then everything works like it should.  I was my own undoing with my use of Refit. 

  • Single user mode: Argument List is too long, PLEASE HELP

    Hey guys,
    I recently posted a topic asking if any1 knew how to delete all png files on the desktop,
    Nt many people replied,
    But anyway, I did some research and now I know how to do it,
    but in single user mode (cmd + S),
    When I typed in rm *.png
    While I ws on the desktop in single user mode,
    It came up saying Argument list too long,
    Does any1 know how to fix this,
    Plz reply ASAP,
    &amp; if possible addme on Skype mark.davidson19, it wld b extremely helpful

    If there are too many files expanded via the *.png wildcard, then the argument list length maximum can be exceeded.  The last time I checked, Mac OS X had a 256K line length limitation. (AIX was 1M, Linux 128K, Solaris 1M, Windows 8K (Cygwin env) - your mileage may vary with each operating system release).
    If you have too many files to expand on the command line, then you can delete them in batches.  There are several ways to do this
    cd ~/Desktop
    rm [a-m]*.png
    rm [n-z]*.png
    rm [A-M]*.png
    rm [N-Z]*.png
    Or finer increments.
    You could use something like
    find ~/Desktop  '*.png' -print0 -depth 1 | xargs -0 rm
    And you can also use
    find ~/Desktop '*.png' -depth 1 -delete
    This being a Unix environment, there are most likely a dozen additional ways to delete all the .png files and avoid command line length limits.
    As MrHoffman says, using rm and wildcards is a very dangerous thing to do unless you really REALLY know what you are doing.  If not, I strongly suggest having a recent full backup handy.  I actually suggest a backup regardless of how good you are in the Unix environment (I have multiple via different backup utilities preformed on a very regular basis;  years of experience has taught me you cannot be too careful with your data - it is worth far more than the cost of backup equipment).

  • SQL 2012 AG - Single User Mode Alternative

    We have a very busy DB in a SQL cluster at the moment, that I am moving to a 2012 AG. Every night, there is a job that moves data around into a bunch of newly created tables. In the cluster, the job uses single user mode to pause incoming data while it makes
    the changes:
    SET SINGLE_USER WITH ROLLBACK AFTER 10 SECONDS
    So I've been looking around, but I'm not a heavy DBA, so I haven't been able to find an alternative for this command in the job. Right now, the job fails every day. It cannot make the necessary changes while data is still flowing into the DB. How can I pause
    the incoming data until the job finishes? Is there a way to take the listener offline temporarily or some other way to make this work?
    Thanks!!

    Partitioning is exactly what we're trying to do. That's where we used single user mode before. Here is the part of the job that required it. Let me know what you think:
    SET
    @Sql='ALTER
    PARTITION FUNCTION '+@PartitionFunctionName+'()
    MERGE RANGE (''' 
    +@FirstBoundaryValue+''')'
    BEGINTRY
    EXECsp_executesql@Sql
    SET@Sql='ALTER
    PARTITION SCHEME '+@PartitionSchemaName+'
    NEXT USED '+@FileGroup
    BEGINTRY
    EXECsp_executesql@Sql
    SET@Sql='ALTER
    PARTITION FUNCTION '+@PartitionFunctionName+'()
    SPLIT RANGE ('''+@NextBoundaryValue+''')'
    BEGINTRY
    EXECsp_executesql@Sql

  • How do I prevent users from logging into my machine in single user mode?

    I established an standard accounts for my family.  My son figured out that if he logs into the machine in Single User mode that he logs in as the root user.  He then proceeded to create another user with administrative privileges and change his account to administrator then delete the other account.  Funny thing about this is that as much as OS X is secure from outside threats a simple command-s gets you right into the very heart of the machine......

    You can set a firmware password. The firmware password only allows you to start up in normal mode, so if you try to start in single-mode user or safe mode, your Mac will ask you for a password.
    The process to turn it on depends on the OS X version you have. Open  > About this Mac, check the Mac OS X version and follow the steps depending on your OS X version.
    If you have 10.7 or 10.8:
    1. Hold Command and R keys while your Mac is starting up.
    2. After starting up into OS X Utilities, go to Utilities menu (on the menu bar) > Firmware Password Utility, and enable the firmware password.
    3. Restart the Mac.
    If you have 10.6 or older:
    1. Insert the Mac OS X disc and hold the C key while your Mac is starting up.
    2. Choose your language, go to Utilities menu (on the menu bar) > Firmware Password Utility, and enable the firmware password.
    3. Restart the Mac.
    Also, this will protect your Mac against thieves because they won't be able to erase the hard drive without knowing the firmware password. Don't forget the password, because only Apple can reset it if you don't know this password

  • HT1492 Single user mode not working.

    Whenever I hit command-s to go into single user mode it doesn't work. I used to do it all the time to help my grandma who doesn't let me know her password, but always forgets it reset her computer. Please help!

    Thank you! The thread you posted had my problem exactly, and the solution. It was the Macally keyboard, so I uninstalled the driver (and single user mode worked), and then I installed an older driver, so now my keyboard works AND single user mode works. If all of my computer problems could be so easy...

  • Patching zfs root in single user mode

    Hi
    I have to apply the Oracle recommended patchset to a server running on zfs root with zone roots also on zfs. The usual method of patching with Live Upgrade is giving some problems after the activation of the ABE. Can the patchset be applied to the server in the traditional single user mode
    Any inputs would be appreciated

    Yes, you can apply the patchset in single user mode, just keep in mind that your zones need to be bootable when patching as the patch installation will "partly" boot each zone when applying the patches. So if your zones rely on any NFS mounts etc, you will need to mount these first.
    An alternative is to detach your zones during patching and then attach them using "zoneadm -z zonename attach -u" (or -U see the zoneadm(1M) man page for details on the differences).

Maybe you are looking for