Showing posts with label irc. Show all posts
Showing posts with label irc. Show all posts

Thursday, 7 March 2013

Extracting logs out of journalctl

Journalctl gives us nice consolidated logs. However, on a number of occasions, we need to extract parts of the logs. There are multiple ways of doing it. To filter by process, you can use PID numbers as shown below.

journalctl _PID=<pid number>

To obtain PID number when you have the process name [or part of the process name], use the following:

ps aux | grep -i <process name>

The manual page only refers to it in examples. A commonly used slicing option is to see logs of current boot only. This can be done as follows.

journalctl -b

Another option is to look at logs of a particular unit only. This can be done in the following way.

journalctl -u <unit name>

The unit name could be some daemon name like 'mysqld'. Unfortunately, this does not work with 'kernel' as a unit. It can be combined with the -b option though. However, I find myself dealing with messages from various units. So, I scan through all messages and find the messages I need. To filter them out, I can use time stamps in the messages using the following format.

journalctl --since='2013-03-06 22:58:34' --until='2013-03-06 23:00:34'

The beginning time stamp works fine; but the ending time stamp does not work. I talked about it at #systemd IRC channel. It is fixed and will be released soon.

Tuesday, 12 June 2012

Reboot on Dell Latitude E6520 with Arch linux

On Dell Latitude E6520 and some other Latitude models, a number of distributions were having issues with reboot. Rebooting by any method, viz.

  • restart command
  • shutdown -r now command
  • or restart from GUI

stopped all processes. The run level goes to 6 and everything works fine. Finally the system shows a message that it is rebooting now but the reboot does not happen. Ubuntu had this bug too but they fixed it and when my friend tried Ubuntu on the same hardware, reboot worked fine for him. I filed a bug in Arch and discussed it on #archlinux. The developers said it is an upstream issue and I was able to find an already reported bug upstream. Looking into the bugs and comments, I figured I should try setting the kernel parameter 'reboot' to 'pci'. So, I changed the kernel line in /boot/grub/menu.lst to include 'reboot' parameter as follows.

kernel /boot/vmlinuz26 root=/dev/sda2 resume=/dev/sda1 ro reboot=pci


After the above change, my system rebooted successfully.


N.B.: 1. Here, /dev/sda2 is my root partition and /dev/sda1 is my swap partition.
         2. Read more about rebooting a system.

Tuesday, 20 October 2009

Screen brightness

The brightness of the lcd of my Thinkpad R60 was an issue for me because I could only decrease the brightness using Fn+End; but could not increase it using Fn+Home as the Home key was defunct.

I figured may be changing some ".conf" can help me out. I checked out with people at #gentoo. Just as I expected, I just had to write appropriate integer values to
/sys/class/backlight
From the maxbrightness file I found the max value for my system was 7. Checking the brightness file, I found the current screen brightness to be at 0. Setting it to 4 was fine with me.

Wednesday, 30 September 2009

Kernel upgrade

For some time I had been trying to upgrade the kernel on my Gentoo box from 2.6.29 to 2.6.30. I was interested in 2.6.30 kernel because of three reasons.

#1 From what I remembered from the experiements with sreadahead, this kernel was supposed to support it well. However, recently when I dug into the topic, Jeremy told me that it is very much a dead project now. I still have baselayout2 and openRC to tinker with to obtain boot speed improvements.

#2 I had a secondary LAN port installed. So, I had to configure my kernel for that. I decided that since a new kernel is available, I shall install the driver and the kernel too.

#3 This kernel supports LZMA compression. I was interested in trying it out.

I compiled the kernel fine, editted grub.conf and rebooted into my experiemental kernel. During the boot, I could clearly see that sreadahead was a dead project. It took me straight to kdm screen. However, after kdm the system froze.

My first idea was to check the command line. So, I restarted and from kdm went to command line. Invoking the following, I found that the driver for the LAN interface was fine.
lspci -k
I was clueless as to what went wrong. I thought I might need to build xorg-server, input drivers and video drivers against my new kernel. So, I ran the following command.
emerge -v xorg-server xf86-video-intel xf86-input-evdev
After that once again, I tried to get back to GUI using. However the system froze again. I thought lets get some help. Checking on #gentoo, I was suggested to try what I had done as explained above. I kept looking at IRC for four days without any solution to my problem. Then, thinking my KDE might be having issues, I tried at #gentoo-kde where Aleister suggested I might have enabled KMS and using xorg-server 1.5 at the same time. My X server log file at
/var/log/Xorg.0.log.old
was reporting fatal server error. Checking my menuconfig, I found that he was right. Disabling that option, I was able to do away with system freezes. All I lost was the two penguins that appeared during boot. The problem was xorg-server 1.5 does not support kernel mode setting (KMS).

Thursday, 17 September 2009

Gentoo incremental updates

Gentoo linux has been releasing weekly snapshots instead of usual long term releases. This is a nice way of providing cutting edge technology. To add to that, Gentoo does not provide updates regular way. Ebuilds are stabilized by developers and whenever we want to update our system, we have to follow the subsequent steps:
* emerge -v --sync
This updates ebuilds.
* emerge -pv --deep --newuse --update world
This gives a list of changes that shall be made. In case, there is change of USE flags, this command will detect the packages that need to be reinstalled.

This unique updating method keeps Gentoo users at cutting edge of technology. However, there are some drawbacks. A dependency resolution problem occurs when a particular package has been stabilized; but some of its dependencies are not. In this case, portage complains that the dependencies are masked. This is what happened to me last night.

emerge -pv --deep --newuse --update world

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! All ebuilds that could satisfy ">=x11-libs/qscintilla-2.4[python]" have been masked.
!!! One of the following masked packages is required to complete your request:
- x11-libs/qscintilla-2.4 (masked by: ~x86 keyword)

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.
(dependency required by "dev-python/PyQt-3.18.1" [ebuild])
(dependency required by "media-sound/amarok-1.4.10_p20090130-r3" [installed])
(dependency required by "world" [argument])

I checked out with people at #gentoo channel on IRC. The discussion could not solve the issue. I decided to postpone the update and got back to work. After about 3 hours, I synced again. The dependency problem wasn't solved. I had not installed any masked packages and PyQt wasn't also present in package.keywords. I was just hoping the incremental releases had got into a situation I described earlier as a drawback of the Gentoo update system. So, I postponed the update till morning.

Today morning, when I synced I noticed a change in PyQt ebuild. When I ran a pretended update, I got the following list of updates.
emerge -pv --deep --newuse --update world

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild N ] app-portage/portage-utils-0.1.29 78 kB
[ebuild U ] app-shells/bash-4.0_p28 [3.2_p39] USE="net%* nls -afs -bashlogger -examples -plugins -vanilla" 6,155 kB
[ebuild U ] dev-db/sqlite-3.6.17 [3.6.16] USE="readline%* threadsafe -debug -doc -soundex -tcl" 2,912 kB
[ebuild U ] sys-devel/libtool-2.2.6a [1.5.26] USE="-test% -vanilla" 717 kB
[ebuild U ] app-emacs/emacs-common-gentoo-1.2 [1.0] USE="X -emacs22icons%" 46 kB
[ebuild NS ] app-editors/emacs-23.1 [22.3-r2] USE="X alsa gpm toolkit-scroll-bars xpm -Xaw3d -dbus -gif -gtk -gzip-el -hesiod -jpeg -kerberos -m17n-lib -motif -png -sound -source -svg -tiff -xft" 33,577 kB
[ebuild U ] virtual/emacs-23 [22] 0 kB
[ebuild U ] app-admin/eselect-python-20090824 [20090606] 5 kB
[ebuild U ] dev-python/sip-4.8.2 [4.7.9] USE="-debug -doc%" 601 kB
[ebuild U ] dev-python/setuptools-0.6-r1 [0.6_rc9] 253 kB
[ebuild U ] sys-libs/pam-1.1.0 [1.0.4] USE="cracklib nls -audit -debug% (-selinux) -test -vim-syntax" 1,564 kB
[ebuild U ] sys-auth/pambase-20090620.1-r1 [20081028] USE="cracklib sha512 -consolekit -debug -gnome-keyring -mktemp -passwdqc (-selinux) -ssh" 3 kB
[ebuild U ] sys-auth/consolekit-0.3.0-r2 [0.2.10] USE="pam -debug -doc% -policykit%" 385 kB
[ebuild U ] app-admin/sudo-1.7.2_p1 [1.7.1-r1] USE="pam -ldap -offensive (-selinux) -skey" 753 kB
[ebuild U ] dev-python/PyQt4-4.5.4-r4 [4.4.4-r5] USE="X dbus kde -assistant -debug -doc -examples -opengl -phonon -sql -svg -webkit -xmlpatterns" 6,808 kB
[ebuild U ] dev-python/PyQt-3.18.1 [3.17.6] USE="-debug -doc -examples" 801 kB

Total: 16 packages (14 upgrades, 1 new, 1 in new slot), Size of downloads: 54,653 kB

My patience finally paid off. However, it would be wrong on your part to take the impression that this is general drawback of the Gentoo release system. That is because I am using KDE 3.5.10, which does not have upstream support any more. Unless you are in such an odd situation like me, Gentoo is a nice way of getting fine-tuned cutting edge software.

P.S.: A Gentoo forums thread clarifies that this is not a singular case.

Monday, 11 May 2009

irc problem

I use BSNL dataone service. Today, after connecting to the internet, I when I fired up Kopete to connect to IRC, I was not able to. I checked my connection with a ping to www.google.com and found my connection to be working fine. So, I checked my Kopete settings to ensure they were alright and so they were. Kopete does not show messages from the server. So, I came back to command line and fired up irssi. I got the following messages:
Irssi: Looking up irc.freenode.org
Irssi: Connecting to irc.freenode.org [213.232.93.3] port 6667
Irssi: Connection to irc.freenode.org established
*** Looking up your hostname...
*** Checking ident
*** Couldn't look up your hostname
*** No identd (auth) response
*** Banned: You have a host listed in the DroneBL.
For more information, visit
dronebl.org/lookup_branded.do?ip=59.93.128.10 Please contact
kline@freenode.net with questions. (2009/05/11 08.32)
ERROR Closing Link: 127.0.0.1 (Banned)
Irssi: Connection lost to irc.freenode.org

I visited the site indicated and found that it had been banned for running an insecure SOCKS server. Now, BSNL assigns a different IP each time you connect. So the obvious solution was disconection and reconnection thereafter.

I requested for removal of the ban because whoever caused the ban is no longer on that IP(, though he may return on it).