LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1734|回复: 7

TS /etc/inittab missing: error install: %pre scriptlet failed exit code 255

[复制链接]
发表于 2005-10-5 08:29:38 | 显示全部楼层 |阅读模式
I am troubleshooting the missing of /etc/inittab on RHEL 4.0. When I am running this command to install initscripts in rescue mode:

rpm -ivh --force --root /mnt/sysimage /mnt/source/Redhat/RPMS/packagename

got error:

error: %pre(initscripts-7.93.11.EL-1) scriptlet failed, exit status 255
error: install: %pre scriptlet failed (2), skipping initscripts-7.93.11.EL-1

If I add --noscripts option to this command, it works. I just need to change the default run level in /etc/inittab from 3 to 5 and machine reboots.

# rpm -ivh --force --noscripts
    --root /mnt/sysimage /mnt/source/Redhat/RPMS/initscripts-7.93.11.EL-1

I don't read this in the old postings. Anyone encountered the same situation? Is it a good practice to use "--noscipts"?

Thanka a lot............
发表于 2005-10-5 14:15:12 | 显示全部楼层
我好像也碰到这个问题,查了一下,好像是http://www.linuxsir.cn/bbs/showthread.php?t=164419
回复 支持 反对

使用道具 举报

发表于 2005-10-7 13:33:52 | 显示全部楼层
Another way:
Under rescue mode, do this:

  1. cd /tmp
  2. rpm2cpio /mnt/source/RedHat/RPMS/iniscripts*.rpm | cpio -idvm
  3. cd etc/
  4. cp inittab /mnt/sysimage/etc/
复制代码

then reboot. You simply avoid to install the whole package again.

OR:

  1. mount -o bind /mnt/source /mnt/sysimage/mnt/source
  2. chroot /mnt/sysimage
  3. rpm -Uvh --force --nodeps /mnt/source/iniscripts*.rpm
复制代码

Make sure you have all the partitions mounted correctly before you do chroot.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-10-9 05:46:38 | 显示全部楼层
I have tested both ways you suggested.

The first one (avoid install the whole package) works very well. I like this way.

The second one (--nodeps)  doesn't work, same error (pre scripts failed). I have to use "--noscripts " option.

Thanks a lot for the response. Now I have a clear picture of what to do when running "rpm -ivh" in rescue mode.
回复 支持 反对

使用道具 举报

发表于 2005-10-9 14:14:07 | 显示全部楼层
Post by zaiwen
I have tested both ways you suggested.

The first one (avoid install the whole package) works very well. I like this way.

The second one (--nodeps)  doesn't work, same error (pre scripts failed). I have to use "--noscripts " option.

Thanks a lot for the response. Now I have a clear picture of what to do when running "rpm -ivh" in rescue mode.

That's strange cause the second way works just fine on my RHEL4
回复 支持 反对

使用道具 举报

发表于 2005-10-10 09:48:09 | 显示全部楼层
Dear yongjian, Could u kindly explain why this issue happened? In another way,what cause that we have to use rpm2cpio?
回复 支持 反对

使用道具 举报

发表于 2005-10-11 02:10:27 | 显示全部楼层
Post by hnull
Dear yongjian, Could u kindly explain why this issue happened? In another way,what cause that we have to use rpm2cpio?

I think its because in the rescue env, you don't have a real root env, so you will have to chroot to the local root env to run rpm (then you will have all rpm prereqs, libs and all that stuff...). But it seems not always like that...
回复 支持 反对

使用道具 举报

发表于 2005-10-11 10:58:39 | 显示全部楼层
Post by yongjian
I think its because in the rescue env, you don't have a real root env, so you will have to chroot to the local root env to run rpm (then you will have all rpm prereqs, libs and all that stuff...). But it seems not always like that...



Thanks a lot :rolleyes:
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表