What more could you want?
Posts tagged Linux
Lazy Umounting
Jun 11th
I came across a mounted sdb1 partition, but the physical device didn’t exist. This was on a Red Hat EL 5 box.
No files in the mount point, obviously, no users logged in but me, and I wasn’t standing in the directory. Even lsof couldn’t show me anything about that directory, and I almost cried when fuser -km reported nothing killed.
Umount gave this error:
# umount /dev/sdb1 umount: /dev/sdb1: device is busy umount: /dev/sdb1: device is busy
In the man page, I found the -l option for umount. The Lazy unmount. It says this:
Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore.
Sounds good to me, and it worked, too. Just watch out for data loss.
/cs
Plesk 9 and PCI compliance
Apr 14th
The basics are easy, as one can attest with a Google search: Apache, Mail, etc.
But, I’ve found that the Plesk CP for Plesk 9 doesn’t run on Apache, it runs on Lighttpd. To disable weak ciphers on a Plesk/Red Hat box, edit /etc/sw-cp-server/applications.d/plesk.conf and add this line:
ssl.cipher-list = “TLSv1+HIGH !SSLv2 RC4+MEDIUM !aNULL !eNULL !3DES @STRENGTH”
I don’t know if you can add it just anywhere, but you ought to be able to. Personally, I put it between the “include_shell” and “index-file.names” lines in the conf, line 11. After all that, issue “service psa restart” and you’re good to go.
You can test the setup using this command:
# openssl s_client -connect localhost:8443 -ssl2
Run that from the box itself, either as root or as a regular user. It gave me a “Connection reset by peer” error on SSLv2 connection. This is expected, and means that SSLv2 has been successfully disabled. Go run that scan again.
Also, keep in mind the recent “Plesk broke openssl” (or vice-versa) fiasco.
/cs
Fglrx and Suspend in Ubuntu Hardy Alpha: Workaround
Mar 17th
Oh, my. What a weird couple weeks it’s been for my laptop…
I started with Alpha5, in which suspend worked. Alpha 6 also supported suspend. Both with the open-source ati driver upon install. Beautiful! Thank you Ubuntu for having an awesome distro!
Supposedly, the xorg-driver-fglrx package in the Ubuntu repos for the Hardy development version addressed the suspend/resume issues that have been the bane of Linux geeks with newer ATI cards eveywhere. I, for one, did not notice that the issue had been resolved.
I DID notice, however, that out-of-the-box, so to speak, suspend worked with the open-source ati driver. I could suspend, resume, hibernate, etc. But, I’m whiney, and wanted my ever-so-cool desktop effects (mostly for the transparent terminals).
Upon installing this xorg-driver-fglrx package, my suspend/resume functionality broke. Ouch. That’s a beta-killer if ever.
I have tried every sort of configuration imaginable, and googled every combination of keywords for fglrx, suspend, hibernate, sleep, resume, ati, proprietary, and on and on. I found several people (with different cards and different configurations) that were successful in manipulating the /etc/default/acpi-support file in such a way that suspend just worked. Hoorah for them! I was still stuck.
I have a Gateway MT3705 with an integrated ATI Radeon XPRESS 200M graphics card:
$ lspci -vv
01:05.0 VGA compatible controller: ATI Technologies Inc RC410 [Radeon Xpress 200M] (prog-if 00 [VGA controller])
Subsystem: Gateway 2000 Unknown device 0318
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 255 (2000ns min), Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 19
Region 0: Memory at d0000000 (32-bit, prefetchable) [size=256M]
Region 1: I/O ports at 9000 [size=256]
Region 2: Memory at c0000000 (32-bit, non-prefetchable) [size=64K]
[virtual] Expansion ROM at c0020000 [disabled] [size=128K]
Capabilities: <access denied>
Pulling info from dpkg, I can see the version and supported cards:
$ sudo dpkg -p xorg-driver-fglrx | grep ‘Version\|Xpress’
Version: 1:7.1.0-8-3+2.6.24.11-12.31
* Radeon Xpress: 1200 series, 1100 series, 200 series
All in all, it is “supposed” to work. I have NO idea why it does not. I am not that far along. In fact, I don’t think the issue is with the driver, after my most recent discovery.
I have successfully been able to suspend and resume my computer for several hours now! Hoorah!
Here is what I have done:
I changed a few things around in the /etc/default/acpi-support file, as per the instructions as cchtml pertaining to Gutsy and Feisty, because they have not yet gotten the Hardy page together (since it’s still alpha, i understand!). Here is my current /etc/default/acpi-support file:
$ sed ‘/^#/d;/^$/d’ /etc/default/acpi-support
ACPI_SLEEP=true
ACPI_HIBERNATE=true
ACPI_SLEEP_MODE=mem
MODULES=”"
MODULES_WHITELIST=”fglrx”
SAVE_VBE_STATE=false
VBESTATE=/var/lib/acpi-support/vbestate
POST_VIDEO=
USE_DPMS=false
DOUBLE_CONSOLE_SWITCH=false
HIBERNATE_MODE=shutdown
LOCK_SCREEN=true
STOP_SERVICES=”"
RESTART_IRDA=false
ENABLE_LAPTOP_MODE=false
SPINDOWN_TIME=12
This is not stock. However, I have made enough changes to it that I am not sure what the stock implementation is anymore! It works now, so I’m cool with it.
Now, if I try to suspend via gnome-power-manager, or the Logout button, it will sleep and blink at me slowly and drearily, but will abruptly tell me to piss off when I try to wake it. Ever poked a sleeping bear? Same thing.
However, if I open my terminal and run this command (in bold), I can sleep and resume, as you can see by the output of the script (not in bold):
$ sudo /etc/acpi/sleep.sh force
ifdown: interface eth0 not configured
ifdown: interface wlan0 not configured
* Shutting down ALSA… [ OK ]
* Saving the system clock
* Setting the system clock
Ignoring unknown interface eth0=eth0.
Ignoring unknown interface wlan0=wlan0.
* Setting up ALSA… [ OK ]
FATAL: Module acpi_sbs not found.
FATAL: Module acpi_sbs not found.
So, when it suspends, I get a grey-and-white-blinky-screen-of-death, and then *poof!* it’s out and peaceful. When returned to a wakeful state, I am greeted with my desktop and session information that I left behind.
Once concern I have is that the screen is not locked when the computer awakens, so theoretically, anyone could awaken my laptop and overtake me completely. Since it is nearly always within arm’s reach, I am not terribly worried. I worked around this issue as such:
$ sudo /etc/acpi/sleep.sh force && gnome-screensaver-command –lock
For me, this is too much to remember, so I have set up a little alias in my ~/.bashrc file called simply “sleep” that performs this command for me when I type, well, “sleep”:
$ grep “alias sle” ~/.bashrc
alias sleep=’sudo /etc/acpi/sleep.sh force && gnome-screensaver-command –lock’
I am a terminal junky, and am perfectly fine with this. But, some people are not, so here’s a GUI-type version of the above. These can be run by pressing Alt-F2, and copying in the commands. You will likely be prompted for a password:
$ gksu gedit /usr/local/bin/sleeparound.sh
Type into file:
#!/bin/bash
gksu /etc/acpi/sleep.sh force && gnome-screensaver-command –lock$ gksu chmod +x /usr/local/bin/sleeparound.sh
Now that the tough terminal part is done, simply add a custom launcher to the panel (right-click the panel, click “Add to Panel…”, click “Custom Application Launcher”) that calls this command. It will prompt you for a password, then sleep, and lock your screen when it wakes up.
Cool.
Now, make a note that during my research, I found that some people had networking problems after resume, particularly pertaining to wireless. I did not, so will not delve into that, but two key things that I saw (which could be added to the sleeparound.sh script) wereunloading and reloading the driver modules for the particular net interface, and restarting the Gnome Network Manager.
I gotta say, I love Linux.
/cs
UPDATE 080319: A smoother version of the command to use for sleep involves using the -S flag for sudo, which causes it to read from standard input. For example, in .bashrc, the alias “sleep” would be comprised of this:
alias sleep=’gnome-screensaver-command –lock && sleep 3 && cat ~/.passfile | sudo -S /etc/acpi/sleep.sh force’
So, in your home directory, issue the command ‘cat > ~/.passfile && chmod 400 ~/.passfile’ and type in your password. Setting the permissions to 400 disallow other users from reading the file (other than root). You can also replace the command in the shell script we created above with this, as well.
This version will lock the screen, then sleep, whereas before, it would sleep, then lock the screen on wake. Sorry – I wrote the last one at like 2 in the morning. /cs
Ubuntu 8.04 Hardy Heron Alpha and Beta testing
Mar 7th
I love Ubuntu. It’s Linux that you can plug in and use quickly, without a whole lot of setup time. I even convinced my Uncle Phil and my Grandmother-in-law to use it, and they are die-hard Windows fans.
Well, wow. My first impression once I got Hardy installed was that the new modern art deco background is a far reach from their traditional “wiggly lines” art.