Find the answer to your Linux question:
Results 1 to 6 of 6
Hello, I'm still new to this forum and linux had a question. I have redhat 4.8 base version no gui- command line only. connected via kvm with other machines, whenever ...
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    3

    Redhat 4.8 Hibernate/Sleep/Standby question

    Hello,

    I'm still new to this forum and linux had a question.

    I have redhat 4.8 base version no gui- command line only. connected via kvm with other machines, whenever it goes to sleep or standby mode(I can't tell the difference) it won't come back unless a ps/2 mouse/keyboard is connected directly into the machine. usb won't wake it up.

    I'd like to turn off the sleep/standby mode completely but when i attempted the xset command it said not found.

    I was told to install xorg-x11-server-utils package but I can't find it for redhat 4.8.. and I have little experience installing rpm packages on linux.


    Any help would be appreciated!

  2. #2
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    Hey,

    I can tell u that on my RHEL 4.3 system, I have xset in /usr/X11R6/bin/xset, and it belongs to the package xorg-x11 (not xorg-x11-server-utils). You can install this package from the original installation media. But let me guess, you don't have those disks, right? You can get them if you have a RHN login (it means a valid license has been purchased for the system to run RHEL and you have an actual login to their network) and an internet connection. A quick yum command would then get it installed for you:

    Code:
    yum install xorg-x11
    Failing that, and you are desperate, you can get the packages from one of the free RHEL clones that exist and are kept relatively current. CentOS is one option, ScientificLinux is another.

    For example, you can browse here to see the binary RPMS for CentOS 4.8, you'll see xorg-x11 in the list:

    http://mirror.centos.org/centos-4/4....EL.63.i386.rpm

    Note that if you try to download and install this package, it will complain about dependency packages that you'll then have to download. It would be easier to set up a quick yum repo file (provided you have an internet connection) or just download the ISO for the install media, and install the RPMS from that.

    This is NOT the way to go, if this is a production server, this is a break-glass kind of thing.

    Having said all that, why are you wanting to use xset exactly? Is it just that the monitor goes to sleep? If so, (and a user is normally logged in), you could put this in a file called "/etc/profile.d/noblank.sh":
    Code:
    [ -n "$TERM" -a "$TERM" != 'dumb' ] && setterm -blank 0
    This would say, if the TERM variable is set (as in someone is logged in) don't blank the screen. If no one ever logs in, does it still blank out on you?

  3. #3
    Just Joined!
    Join Date
    Jan 2012
    Posts
    3
    I think the only user that would be logged in would be root- it's the command line on version, theres no GUI.

    If I could use that file and set it to whenever root is logged on that would be fine.

    So I can't use that RPM you provided? because it could cause problems? A little confused- the XSET option seems a bit complex for what I need, if I need to go and install rpms that could affect production servers etc.

    Essentially- all I want to do is ensure that the monitor never, ever turns off, even when I physically turn off the monitor lol.

    and thank you for your response.. I appreciate it

  4. #4
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    Regarding install the RPMs, I meant to provide you with sufficient information to make the call yourself as to whether or not you want to install it. Basically, it should work just fine, but don't expect to get any support from Red Hat on the system if you do that. But like you hinted, I don't think you actually need the xset method.

    As for using the setterm suggestion, I haven't tested it out on a system where nobody was logged on - btw, by logged on, I mean on a non-GUI system, logged in on a Virtual Console (black screen white text, etc.). If nobody is logged on, and it is just at the login screen, I don't think my monitor turns off, that may be a physical monitor setting, though.

    If however, somebody is logged in, then yes, the terminal will shut itself off, by default. That is where the setterm trick comes in handy for me. If your situation is that it turns off when somebody is logged on, then try my suggestion about creating the "/etc/profile.d/noblank.sh" file.

  5. #5
    Just Joined!
    Join Date
    Jan 2012
    Posts
    3
    I'd like to thank you for your prompt and informative responses!

    I think your .sh file will work but some clarification is needed on my end(since i'm the definition of a rookie in linux)

    I use vi to open a .sh file and add

    [ -n "$TERM" -a "$TERM" != 'dumb' ] && setterm -blank 0

    then i'd have to run the .sh file?

    Would I have to run the file each time the system starts up? or is there a command I can put that permanently sets this?

  6. #6
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    Good question. It all depends on where you put that file. If you do not put it in a specific place, then you'd have to source it, e.g.:

    Code:
    . ~/noblank.sh
    That would get old. To get around this, you could put it in your ~/.bashrc file, which gets automatically sourced whenever you log on, e.g.:

    Code:
    [root@localhost ~]# cat ~/.bashrc
    # .bashrc
    
    # User specific aliases and functions
    
    # Source global definitions
    if [ -f /etc/bashrc ]; then
            . /etc/bashrc
    fi
    
    [ -n "$TERM" -a "$TERM" != 'dumb' ] && setterm -blank 0
    You could man bash and look at the files listed under FILES to get a better idea.

    However, if you want a system-wide solution, then you could put the file containing the setterm command in /etc/profile.d/. The only thing you have to be sure to do is give it a ".sh" file extension. This will ensure that any user who logs into the system, that uses the bash shell, will source that file (in fact, all *.sh files in /etc/profile.d/ will get sourced). btw, the same is true of files in that dir ending in ".csh" for csh/tcsh shell users.
    Last edited by atreyu; 01-16-2012 at 09:36 PM. Reason: bold man command

Posting Permissions

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