Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all, I am trying to eject the cdrom from a livecd after certain stage... Now assuming that it is possible to eject,please consider my issue!!! The OS boots into ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    20

    How do i change to super user then revert back to ordinary user ,using shell script?

    Hi all,

    I am trying to eject the cdrom from a livecd after certain stage...
    Now assuming that it is possible to eject,please consider my issue!!!

    The OS boots into a regular user by default...so i am unable to use the eject command to push out the drive...
    However if i try pfexec eject it works....but then again it works only when the system is completely up and running not at some intermittent stage in the boot process.

    How do i change the my id to a Superuser then execute the eject command ,then once the eject is done with, i would like to revert back to the ordinary user?
    Secondly this code should be incorporated into one of the boot scripts,
    So that after a certain stage during the boot, the drive automatically ejects......

    How do i do it.....

    PS:i urge you to consider that ejecting the media on a livecd is possible.

    Thanks

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    Quote Originally Posted by wrapster View Post
    Hi all,

    I am trying to eject the cdrom from a livecd after certain stage...
    Now assuming that it is possible to eject,please consider my issue!!!

    The OS boots into a regular user by default...so i am unable to use the eject command to push out the drive...
    However if i try pfexec eject it works....but then again it works only when the system is completely up and running not at some intermittent stage in the boot process.

    How do i change the my id to a Superuser then execute the eject command ,then once the eject is done with, i would like to revert back to the ordinary user?
    Secondly this code should be incorporated into one of the boot scripts,
    So that after a certain stage during the boot, the drive automatically ejects......

    How do i do it.....

    PS:i urge you to consider that ejecting the media on a livecd is possible.

    Thanks
    If you want super user option for particular command use

    Code:
    sudo commandname
    To use sudo command i think you need to edit /etc/sudoers file.



    I think If you can re-adjust the permission setting in /etc/fstab in Fedora versions.(It is somewaht risky )

    You can mount or unmount the devices .
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  3. #3
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    How do i change the my id to a Superuser then execute the eject command ,then once the eject is done with, i would like to revert back to the ordinary user?
    Secondly this code should be incorporated into one of the boot scripts,
    So that after a certain stage during the boot, the drive automatically ejects.
    Boot scripts run as root, so you don't need to worry about getting into root and back to an ordinary user.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...