LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 01-06-2015, 09:10 PM   #1
stevetronik
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Rep: Reputation: Disabled
create autorun CD deploy files from cd to redhat automatically


I added autorun file at CD root
Code:
#!/bin/bash
./setup
eject CDROM
Under system>preference>removable drives and media, I have enabled to auto run when CD is detected but a auto-run confirmation pop up. Is there a way to bypass this pop as my objective is to create a auto run CD to deploy files without GUI. And also eject cdrom doesn't work as intended the CD doesn't eject itself after setup is completed, how should I go about making it automatically eject the CD when setup script or executable is completed? Thank you.
 
Old 01-07-2015, 01:14 AM   #2
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by stevetronik View Post
I added autorun file at CD root
Code:
#!/bin/bash
./setup
eject CDROM
And also eject cdrom doesn't work as intended the CD doesn't eject itself after setup is completed, how should I go about making it automatically eject the CD when setup script or executable is completed? Thank you.
You're running a script from a mounted filesystem that attempts to eject that filesystem. It may be possible to work around this, but as long as the script is running, the filesystem is set as 'active' and the kernel will not allow you to unmount it, let alone eject it.
Perhaps you should try the technique employed by a live-cd which creates a virtual drive in ram. The software to be executed is copied over to the virtual drive and this frees up the media device to be unmounted and ejected.


Quote:
Originally Posted by stevetronik View Post
I have enabled to auto run when CD is detected but a auto-run confirmation pop up. Is there a way to bypass this pop as my objective is to create a auto run CD to deploy files without GUI.
I'm not certain how to go about this, but my guess would be that you would need to modify some low-level configuration to achieve this. This is a security feature and disabling that pop-up reduces security on the system.
 
Old 01-11-2015, 02:10 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Wonder if rh has it tied to name more exactly. Autorun.sh is their suggested name.

Log on to RH portal for pages related to this topic. https://access.redhat.com/solutions/481873 and
https://access.redhat.com/solutions/432703
 
Old 01-11-2015, 04:55 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
that might be a bit harder than on the old windows XP( this was a MAJOR security problem for MS )

autorun for a dvd or cd and usb has been DISABLED for very good reasons for some YEARS now
( even on win7 and 8 )
re-enabling it normally is not a good idea

Quote:
as my objective is to create a auto run CD to deploy files without GUI
this is normally frowned upon
poping in a disk and have it autorun code WITHOUT ASKING FIRST is something most of us here hate with a passion


and normally is something done by " The Bad Guys "

Last edited by John VV; 01-11-2015 at 04:57 PM.
 
Old 01-15-2015, 03:52 PM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Moderator response

Moved: This thread is more suitable in <Red Hat> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 01-19-2015, 08:58 PM   #6
stevetronik
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
The intention was to make the installer dummy proof and minimalistic. What about a way of having it eject the CD after everything is done. I can live with having to click the autorun button when it pops up. But no terminal exist to show the copy process even if I used verbose in the autorun script. Is there a way to make a terminal appears and/or cause the CD to eject from the autorun script. Thanks everyone
 
Old 01-20-2015, 12:11 AM   #7
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by stevetronik View Post
Is there a way to make a terminal appears
Well, here's some code from the cb-welcome script used in Crunchbang. You may have to modify it slightly to work for your needs.
Code:
# Open in terminator
if [ "$1" = "--open" ]; then
    if [ -x "/usr/bin/terminator" ];then
        terminator --title="#! Post-installation Script" --command="cb-welcome"
        exit 0
    fi
fi
As to getting the cd to eject, you can't do this from a script running from that cd. but you can try copying the script to a ram drive first.
 
  


Reply

Tags
autorun, cdrom, installation, redhat, script



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to automatically create executable files skiabox Linux - Newbie 2 10-26-2011 03:57 PM
can I create autorun thumb drive in ubuntu? rosy Jovita Linux - Newbie 7 05-07-2010 09:17 AM
Is it possible to create autorun for CD..open a html file... niroperera Linux - General 3 09-01-2008 04:40 AM
How to create a disaster recovery of my files automatically sacoskun Linux - Software 1 04-07-2008 08:49 PM
How to create autorun CDs in Linux shivanand Linux - General 5 04-04-2005 07:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 08:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration