Systems Thoughts

关于IT,技术,互联网及其他,一个人在瑞典

转载原创文章请注明,转载自:Systems Thoughts
[http://www.systemsthoughts.com/blog]

话说今天重新更新系统后,终于又进入了久违的桌面,但是发现以前一直正常的scim突然不能用了。检查了etc/gtk-2.0下得文件,还有用户目录下得.xinitrc,应该都没问题。在终端下输入export,发现.xinitrc里的东西根本没有被执行,怎么回事不知道。

后来看论坛和wiki上说gdm不会读.xinitrc,应该用.xprofile代替,抱着试试看的心理把.xinitrc里关于scim的东西移到.xprofile里。重启Gnome,居然成功了。

#SCIM
export LC_CTYPE="en_US.utf8"
export XIM="SCIM"
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
scim-d

如果你也和我一样用gdm作为窗口管理器的话(其实kdm也是这样),试着把scim移到.xprofile里吧。

Comments (0) Posted on Thursday, October 16th, 2008

转载原创文章请注明,转载自:Systems Thoughts
[http://www.systemsthoughts.com/blog]

今天在公司又试了几下,还是不行。后来更新系统时发现wine有个包下不下来,心想也许那些文件大面积出错也许是镜像服务器有问题?换了一个pacman的服务器,用这个命令:

pacman -S $(pacman -Qq | grep -v "$(pacman -Qmq)")

把系统里的包重装了一下,果然好了,虽然VLC一样会扔出segmentation fault,有些设置文件被改写,可是总算又能用了….

不过现在系统里的中文调不出来了,似乎系统不会读用户目录下得.xinitrc文件了,还在调查事故原因。

Comments (2) Posted on Thursday, October 16th, 2008

转载原创文章请注明,转载自:Systems Thoughts
[http://www.systemsthoughts.com/blog]

现在每次关机都会有这个东西,很annoying

/var/run/gdm.pid doesn't exist, perhaps GDM isn't running

查了查,原来是我X11启动方法不对,我是照着Arch Linux Beginner Wiki搞得,其实上边有很多东西Out of date。按照上边的方法,gdm给放在etc/rc.conf的daemon里面了:

DAEMONS=(syslog-ng dbus !network cpufreq laptop-mode netfs crond alsa acpid !net-profiles hal fam networkmanager gdm dhcdbd vboxnet @sshd)

把它移走,现在我的rc.conf是:

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="Europe/Stockholm"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
#MODULES=(e1000e iwl4965 snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-hda-intel soundcore)
MODULES=(acpi_cpufreq cpufreq_ondemand cpufreq_stats cpufreq_powersave cpufreq_conservative vboxdrv ac battery button dock processor thermal video wmi firmware_class hci_usb cdrom agpgart intel-agp nvram hid usbhid i2c-i801 i2c-core evdev ff-memless joydev pcspkr psmouse serio_raw led-class compat_ioctl32 uvcvideo v4l1-compat videodev thinkpad_acpi mmc_core ricoh_mmc sdhci pci_hotplug shpchp rtc-cmos rtc-core rtc-lib nvidia output snd-mixer-oss snd-pcm-oss snd-hwdep snd snd-page-alloc snd-pcm snd-timer snd-hda-intel soundcore pata_acpi ata_generic scsi_mod ahci ata_piix e1000e bluetooth mac80211 rfkill iwl4965 iwlcore cfg80211 pcmcia_core rsrc_nonstatic yenta_socket usbhid usbcore ehci-hcd uhci-hcd ieee1394 ohci1394 sd_mod sr_mod)

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="t61"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
# - prefix an entry in INTERFACES with a ! to disable it
# - no hyphens in your interface names - Bash doesn't like it
#
# DHCP: Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#
eth0="dhcp"
#wlan_wlan0="wlan0 essid Buffalo"
#wlan0="dhcp"
#wlan_wlan0="wlan0 essid Buffalo key s:12345"
INTERFACES=(lo !eth0 !wlan0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
# - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.5.1"
ROUTES=(!gateway)

# Enable these network profiles at boot-up. These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
# - set to 'menu' to present a menu during boot-up (dialog package required)
# - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(home)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
# - prefix a daemon with a ! to disable it
# - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng dbus !network cpufreq laptop-mode netfs crond alsa acpid !net-profiles hal fam networkmanager dhcdbd vboxnet @sshd)

然后改变etc/inittab里的启动进程,现在我的inittab是:

# /etc/inittab
#
# Runlevels:
# 0 Halt
# 1(S) Single-user
# 2 Not used
# 3 Multi-user
# 4 Not used
# 5 X11
# 6 Reboot

## Only one of the following two lines can be uncommented!
# Boot to console
#id:3:initdefault:
# Boot to X11
id:5:initdefault:

rc::sysinit:/etc/rc.sysinit
rs:S1:wait:/etc/rc.single
rm:2345:wait:/etc/rc.multi
rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p

# -8 options fixes umlauts problem on login
c1:12345:respawn:/sbin/agetty -8 38400 vc/1 linux
c2:2345:respawn:/sbin/agetty -8 38400 vc/2 linux
c3:2345:respawn:/sbin/agetty -8 38400 vc/3 linux
c4:2345:respawn:/sbin/agetty -8 38400 vc/4 linux
c5:2345:respawn:/sbin/agetty -8 38400 vc/5 linux
c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# Example lines for starting a login manager
#x:5:respawn:/usr/bin/xdm -nodaemon
x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/opt/kde/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >& /dev/null

# End of file

非常neat。用了arch确实因为解决问题对linux了解更深了,看似很麻烦,但是由于网上社区很活跃,其实很多东西只要google一下就能解决。估计用gentoo能学到更多把,呵呵,不过我觉得arch已经很合适了。

Comments (9) Posted on Tuesday, September 23rd, 2008

转载原创文章请注明,转载自:Systems Thoughts
[http://www.systemsthoughts.com/blog]

起因都是Ubuntu的挂起时好时坏。这次挂起恢复好像很成功(但是用Ctl+alt+f8切到信息屏发现显示乱码,本想查查磁盘写入是否成功的),然后用了用也没什么,就开始冲浪了。信息栏一变,显示可以升级了。平时经常发生也没注意,可是后来发现终端长时间挂起,原来是生成新内核所需文件,等了很长时间都没动静,我冒险重启了~~后来….
启动不进去了,不管是不是recovery mode。屏幕显示:

Kernel panic - not syncing:VFS:Unable to mount root fs on unknown - block(0,0)

一下子我也panic了,可是网上说和menu.lst有关我进grub并没发现什么异常。后来决定mount到我的/目录看看。

用光盘启动后,在media下建了一个sda2目录,然后

mount /dev/sda2 /media/sda2

这样就看到了我的/目录了,进入/media/sda2/boot下,发现一些升级的临时文件,新内核字节为….0-_-!

观察了一下内核版本号和大小还有建立时间,决定把光盘上的内核直接拷过去。

sudo cp -v /boot/* /media/sda2/boot/

然后重启….啊,可爱的桌面….

这时候执行一下sudo apt-get update,发现apt包关联有点混乱,按照提示修复即可。我爱linux~~

update:最好再进synaptic package manager里吧新内核reinstall一下,要不系统还以为你已经升级完了,其实用的还是老内核…

Comments (4) Posted on Saturday, May 31st, 2008

转载原创文章请注明,转载自:Systems Thoughts
[http://www.systemsthoughts.com/blog]

  1. 给Firefox用上内存做交换区(来源)在/etc/fstab加入:

    tmpfs /tmp/cache tmpfs size=128M 0 0

    然后建立/tmp/cache目录

    sudo mkdir /tmp/cache

    然后加载

    sudo mount -a

    在Firefox里地址栏输入 about:config.加入新字串[browser.cache.disk.parent_directory],它的值是你的目录位置 重启Firefox就会发现速度有变化(希望是变快:)

  2. 几个其他小改动(来源)关掉IPV6,在/etc/modprobe.d/aliases里找到

    alias net-pf-10 ipv6

    改为

    alias net-pf-10 off #alias net-pf-10 ipv6

    主机名和localhost关联,在/etc/hosts,改成如下的东西

    127.0.0.1 localhost yourhost
    127.0.1.1 yourhost

未完待续…

Comments (1) Posted on Saturday, December 29th, 2007