September 2014
M T W T F S S
« Mar    
1234567
891011121314
15161718192021
22232425262728
2930  
155

Refs

Categories

Archives

profile for slm on Stack Exchange, a network of free, community-driven Q&A sites

Setup Sun Java instead of Ice Tea on Fedora 10

Recently I had a couple of apps that I use for work that insisted on having Sun’s version of Java installed instead of the open source version of Java called Ice Tea. I typically would just use yum/rpm to rip out the rpms I don’t want and replace them with the ones that I want. But through my internet surfing I had noticed that Fedora had adopted Debian’s approach of using the command alternatives to manage multiple installs of apps that use the same commands in /usr/bin. So I took this opportunity to try it out.

Using the ever helpful posts of Mauriat Miranda it was actually quite easy.

First I downloaded a suitable version of sun java (JRE) from here. Next I did the following commands to add it as the preferred version of java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# before install, java version
% java version "1.6.0_0"
OpenJDK  Runtime Environment (build 1.6.0_0-b11)
OpenJDK Server VM (build 1.6.0_0-b11, mixed mode)
 
# make sun java the preferred java
% sudo alternatives --install /usr/bin/java java /usr/java/default/bin/java 20000
#      ^^^NOTE: full path: /usr/sbin/alternatives
 
# after install and alternatives
% java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

To switch the Mozilla/Firefox browser plugins for 32-bit:

1
2
% sudo alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so \
libjavaplugin.so /usr/java/default/plugin/i386/ns7/libjavaplugin_oji.so 20000

For 64-bit:

1
2
% sudo alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so \
libjavaplugin.so.x86_64 /usr/java/default/lib/amd64/libnpjp2.so 20000

NOTE: To switch back to OpenJDK run the following commands one by one and switch between OpenJDK & Sun Java:

1
2
3
4
5
6
7
% sudo alternatives --config java
 
# (for 32-bit)
% sudo alternatives --config libjavaplugin.so
 
# (for 64-bit)
% sudo alternatives --config libjavaplugin.so.x86_64

Setting up On Screen Display on a Thinkpad under Fedora 10

This is total eye candy but I like the OSD that often shows up when you use the special keys on computers and laptops. There is a program called TPB that you can use to get OSD working on a Thinkpad, so when you startup TPB it will add a green OSD towards the bottom of your screen, and the OSD shows up whenever you use the special keys. For example when I hit the volume +/-i or the Mute button for example. So, first things first, we need to install it.

1
% yum install tpb

Once it’s installed you can configure it using the file /etc/tpbrc. The default font kinda sucked so I changed it to lucidatypewriter.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
 
## OSDFONT
# Defines the font for the on-screen display. You may use "xfontsel" to choose
# one. Default is the default font of the xosd library.
#
 
# Original font setting
#OSDFONT     -*-luxi sans-*-r-*-*-17-*-*-*-*-*-*-*
 
# New font setting
OSDFONT     -*-lucidatypewriter-*-*-*-*-34-*-*-*-*-*-*-*
 
...
Original font example
TPB using original font

TPB using original font

New font example
TPB using new font

TPB using new font

To make tpb start up between reboots you can add it to /etc/rc.local

1
2
3
# start tpb during boot in daemon mode
 
/usr/bin/tpb -d

Increasing RAM in a OpenVZ Virtual Environment

Recently I started to get a strange error with one of my OpenVZ VE nodes. This VE is the one that maintains my MySQL database for my WordPress blog. Here’s the error I was getting.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# inside the OpenVZ VE
 
% yum update
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
 * atrpms: dl.atrpms.net
 * extras: mirror.anl.gov
 * rpmforge: ftp-stud.fht-esslingen.de
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 105, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 289, in doCommands
    self._getTs()
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 85, in _getTs
    self._getTsInfo()
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 91, in _getTsInfo
    self._tsInfo.setDatabases(self.rpmdb, self.pkgSack)
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 537, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 392, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 214, in populateSack
    self.doSetup()
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 66, in doSetup
    self.ayum.plugins.run('postreposetup')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 169, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/fastestmirror.py", line 90, in postreposetup_hook
    repomirrors[str(repo)] = FastestMirror(repo.urls).get_mirrorlist()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 142, in get_mirrorlist
    self._poll_mirrors()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 155, in _poll_mirrors
    pollThread.start()
  File "/usr/lib/python2.4/threading.py", line 416, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread
</lambda>

Yup, it made a lot of sense to me as well. Seemed to be something with yum’s fastermirror plugin, or so I thought, so I just disabled it and was able to get a little further like this:


…. Continue reading → Increasing RAM in a OpenVZ Virtual Environment »»

Setting up a linux workstation to use a centrally managed CUPS installation

I always forget to do this every time I setup a new client in my network so I’m writing it down here. I have a print server in my intranet and use CUPS to share my printers out to my linux and windows machines. The mis-config shows up like this to start:

1
2
% lpq
lpq: error - no default destination available.

It usually takes a couple of minutes to remember/figure out what I’m doing wrong here. Then it dawns on me that I need to modify the client.conf file. In order to get a client machine running CUPS to know about a print server I have to modify its client.conf file.

Add this to the file, /etc/cups/client.conf which is usually empty to start:

1
ServerName print.bubba.net

Restart cups and you should be all set.

1
/etc/init.d/cups reload

Getting VMware 1.x Server Running on Fedora 10

As part of the aftermath of my Fedora Core 6 laptop getting dropped, I needed to do several re-installs of key apps. One of the more critical ones was VMware Server 1.08. I’m not a big fan of the 2.x version of this product so I’d rather just continue using the 1.x version.

In what has pretty much become the norm with VMware, every kernel upgrade, invariably breaks VMware. Since I had previously been using Fedora Core 6, a deprecated release, I hadn’t had a kernel update in a while, so I didn’t really have to deal with kernel churn. Now back on the bleeding edge with Fedora 10 I’m once again having to keep VMware Server working everytime a new kernel comes out.

So to start, I made sure I had the latest and greatest version of the 1.x VMware Server branch. I prefer to work with RPMs, so I grabbed the RPM version of the package. Upon installing it I ran into the following.

1st install attempt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
## install vmware rpm
% rpm -ivh VMware-server-1.0.8-126538.i386.rpm 
Preparing...                ########################################### [100%]
   1:VMware-server          ########################################### [100%]
 
# configure vmware
% vmware-config.pl
...
...
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config10/vmmon-only'
make -C /lib/modules/2.6.27.19-170.2.35.fc10.i686/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.27.19-170.2.35.fc10.i686'
  CC [M]  /tmp/vmware-config10/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config10/vmmon-only/./include/machine.h:24,
                 from /tmp/vmware-config10/vmmon-only/linux/driver.h:15,
                 from /tmp/vmware-config10/vmmon-only/linux/driver.c:49:
/tmp/vmware-config10/vmmon-only/./include/x86.h:830:1: warning: "PTE_PFN_MASK" redefined
In file included from include/asm/paravirt.h:7,
                 from include/asm/irqflags.h:55,
                 from include/linux/irqflags.h:57,
                 from include/asm/system.h:11,
                 from include/asm/processor.h:17,
                 from include/linux/prefetch.h:14,
                 from include/linux/list.h:6,
                 from include/linux/module.h:9,
                 from /tmp/vmware-config10/vmmon-only/linux/driver.c:12:
include/asm/page.h:22:1: warning: this is the location of the previous definition
In file included from /tmp/vmware-config10/vmmon-only/linux/vmhost.h:13,
                 from /tmp/vmware-config10/vmmon-only/linux/driver.c:71:
/tmp/vmware-config10/vmmon-only/./include/compat_semaphore.h:5:27: error: asm/semaphore.h: No such file or directory
/tmp/vmware-config10/vmmon-only/linux/driver.c:146: error: unknown field ‘nopage’ specified in initializer
/tmp/vmware-config10/vmmon-only/linux/driver.c:147: warning: initialization from incompatible pointer type
/tmp/vmware-config10/vmmon-only/linux/driver.c:150: error: unknown field ‘nopage’ specified in initializer
/tmp/vmware-config10/vmmon-only/linux/driver.c:151: warning: initialization from incompatible pointer type
/tmp/vmware-config10/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
/tmp/vmware-config10/vmmon-only/linux/driver.c:1670: error: too many arguments to function ‘smp_call_function’
make[2]: *** [/tmp/vmware-config10/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config10/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.27.19-170.2.35.fc10.i686'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config10/vmmon-only'
Unable to build the vmmon module.
 
For more information on how to troubleshoot module-related problems, please 
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".
 
Execution aborted.

Googling a bit produced this blog post and this wiki post. According to the blog post you need to apply the following patch set to VMware 1.08 to get it to work with the newer 2.6.27 kernels. Here’s a link to the original tarball of the patchset, as well as a link to a local copy I have cached on my site.


…. Continue reading → Getting VMware 1.x Server Running on Fedora 10 »»

Fedora 10 and root Desktop Login

UGHH

Recently one of my kids knocked my Fedora Core 6 laptop off of a counter and sent the hard drive for a loop. This rendered the drive inaccessible. So I threw spinrite at it and after ~6 hours several sectors that were damaged were repaired/pulled out and the data moved to a different location on the drive.

Please be alright … Please be alright …

When I rebooted my EXT3 partition weighed in and had all kinds of fits about the drive being dropped as well too. I was able to get onto the system and copy most everything that I wanted off of it using scp to another system. Mind you I did have to go into the dreaded /lost+found directory to recover the data but by in large it was all there.

Light at the end of the tunnel

So I wiped the drive clean and took the opportunity to upgrade to Fedora 10. Now way back when I setup Fedora Core 6 on my Thinkpad T42 I had to do a lot of hacking and customizing to get the lappy to work optimally with FC6. For example, sleep mode when I closed the lid and the special keys to actually work, among other things.

All I can say is WOW. Everything that I had to manually monkey around with just works now! The only thing missing was a package I found out about from thinkwiki to get the nifty OSD when I hit the mute & volume keys.

Problem #1, didn’t take long 8-)

One thing that I just do even though it’s considered bad practice is to just run as root on a laptop. It’s just easier and I don’t have to fight with it too much otherwise.

So when I tried to login as root at the GDM prompt I was presented with an annoying although somewhat expected problem where it wouldn’t let me login as root to GNOME. I knew it had something to do with security and most likely PAM or some such, so I googled for “fedora 10 login as root desktop” and the first hit was a page over on cyberciti.biz that said you could disable this “feature” by commenting out a line in the /etc/pam.d/gdm file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#%PAM-1.0
auth     [success=done ignore=ignore default=bad] pam_selinux_permit.so
#auth       required    pam_succeed_if.so user != root quiet
auth       required    pam_env.so
auth       substack    system-auth
auth       optional    pam_gnome_keyring.so
account    required    pam_nologin.so
account    include     system-auth
password   include     system-auth
session    required    pam_selinux.so close
session    required    pam_loginuid.so
session    optional    pam_console.so
session    required    pam_selinux.so open
session    optional    pam_keyinit.so force revoke
session    required    pam_namespace.so
session    optional    pam_gnome_keyring.so auto_start
session    include     system-auth

Doing this did the trick!

Page 30 of 34« First...1020...2829303132...Last »