您尚未登录。

#1 2015-03-01 16:38:30

liuc
会员
注册时间: 2014-12-29
帖子: 14

如何查看启动的服务

之前在vmware里安装arch但是不能连网。昨天重新安装不知道网络接口是什么,网上翻阅了很多资料,知道/sys/class/net下面能够看到网络接名称。。
进入正题:由于之前一直使用的debian与树莓派的raspbian,所以对debian系的比较熟悉,现在换了arch发现使用命令有些不同。百度了很多资料,会发现都是2013年之前的文章,里面也没有更新,所以在论坛里发帖求助。
1,如何启动服务。安装了openssh了,ssh连接不上,我不知道是否已经启用ssh,于是使用了"serveice ssh status"。结果显示command not found,然后想使用“/etc/rc.d/ssh status”,然后发现arch的/etc目录下是没有rc.d目录的。网上找到的也是这个。。请教arch下如何启动/查看/停止服务的。
2,如何使用yaourt。看到wiki是在/etc/pacman.conf下加入源(有点疑惑,arch的源不是在/etc/pacman.d/mirrorlist的吗?后来把源加入这个文件里面),然后pacman -Syu yaourt 都不能安装yaourt。
3,进入不了图形界面呀(玩archlinux真的是需要折腾精神)。已经pacman安装了xf86-video-vmware 的显示驱动(之前安装的xf86-video-vesa,使用startx显示的是xinit:unable to connect to X server :connection refused,所以就在继续百度,发现显示驱动不对,删除了xf86-video-vesa,安装xf86-video-vmware),现在仍然不能进入图形界面,一闪而过,仍然停留在命令行。(已经安装了pacman -S xorg-server xorg-server-utils xorg-utils xorg-xinit。同时安装了xfce4)。现在出错的提示是
current version of pixman:0.32.6
before reporting problems,check http://wiki.x.org
to make sure that you have the latest version.
Markers:(--)probed,(**)from config file,(==)default setting,
    (++)from command line,(!!)notice,(II)not implemented,(??)unknown.
(==)Log file:"/var/log/Xorg.0.log",Time:sun mar 1 16:01:36 2015
(==)Using system config directory "/usr/share/X11/xorg.conf.d"
/etc/X11/xinit/xinitre:line 55:exec:xterm:not found
xinit:connection to X server lost
waiting for X server to shutdown (II)server terminated successfully(0).closing log file.

要如何解决呢

离线

#2 2015-03-01 19:32:01

wych
论坛版主
注册时间: 2011-11-27
帖子: 103

Re: 如何查看启动的服务


Twitter@wych42

离线

#3 2015-03-01 20:01:23

wongsyrone
会员
注册时间: 2015-03-01
帖子: 1

Re: 如何查看启动的服务

第三个问题参考:

https://wiki.archlinux.org/index.php/In … _in_VMware

而且

/etc/X11/xinit/xinitre:line 55:exec:xterm:not found

貌似没找到 xterm

最近编辑记录 wongsyrone (2015-03-01 20:04:21)

离线

#4 2015-03-01 20:03:17

luxni
会员
注册时间: 2014-06-08
帖子: 280

Re: 如何查看启动的服务

1:服务管理是用systemctl,你可以找下man,WIKI上也有
https://wiki.archlinux.org/index.php/Sy … 6%96%87%29

2:是在/etc/pacman.conf文件里添加源

[archlinuxfr]
Server = http://repo-fr.archlinuxcn.org/$arch

为什么要把它放在pacman.conf里,这个我也不知道。
应该是为了区别官方源和非官方源吧,方便管理,/etc/pacman.d/mirrorlist里都是官方的镜像


虽然人菜菜的,但也想做个有趣的人。

离线

#5 2015-03-01 20:03:57

nopriler
会员
注册时间: 2012-01-03
帖子: 393

Re: 如何查看启动的服务

1.
Arch 使用的 init 软件是 systemd。systemd 用来管理服务的命令是 systemctl,启动/查看/停止服务分别用参数选项 start/status/stop。
启动 ssh 服务可以

# systemctl start sshd

要让 ssh 服务自启动可以

# systemctl enable sshd

2.

pacman.conf 有 include 支持包含其他文件的内容。在有多个 Server 的情况下,pacman 优先使用第一个。如果 LZ 并没有把新 Server 放在第一行,pacman  优先使用旧镜像,而旧镜像中并没有 yaourt 包,因此无法获取 pacman。

3.

请给出执行命令。

line 55:exec:xterm:not found

从这行的提示来看,LZ 应该是执行了 startx,但在执行前没有进行过配置,以启动 xfce,因此 startx 使用了预设配置,在这里 startx 尝试启动 xterm 但因为 LZ 并未安装过而失败。
要配置 startx 启动 xfce,
首先执行

$ cp /etc/skel/.xinitrc ~/

然后往 ~/.xinitrc 里添加 exec startxfce4,再 startx
或直接执行

$ xinit /usr/bin/startxfce4

最近编辑记录 nopriler (2015-03-01 20:05:25)

离线

#6 2015-03-01 21:15:54

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,491
个人网站

Re: 如何查看启动的服务

推荐使用 [archlinuxcn] 源来安装 yaourt。国内大学有镜像,速度快~

离线

#7 2015-03-01 21:24:36

liuc
会员
注册时间: 2014-12-29
帖子: 14

Re: 如何查看启动的服务

英文的wiki比较全面呀。看来只要仔细看都会有收获的,度娘不到自己想要的东西。但是中文的wiki不太全还是我没有找到页面。我要是有空就去帮着翻译wiki

离线

#8 2015-03-01 21:26:19

liuc
会员
注册时间: 2014-12-29
帖子: 14

Re: 如何查看启动的服务

luxni 说:

1:服务管理是用systemctl,你可以找下man,WIKI上也有
https://wiki.archlinux.org/index.php/Sy … 6%96%87%29

2:是在/etc/pacman.conf文件里添加源

[archlinuxfr]
Server = http://repo-fr.archlinuxcn.org/$arch

为什么要把它放在pacman.conf里,这个我也不知道。
应该是为了区别官方源和非官方源吧,方便管理,/etc/pacman.d/mirrorlist里都是官方的镜像

谢谢。原来是使用不同的管理工具了,现在开始学习systemctl了

离线

#9 2015-03-01 21:28:10

liuc
会员
注册时间: 2014-12-29
帖子: 14

Re: 如何查看启动的服务

nopriler 说:

1.
Arch 使用的 init 软件是 systemd。systemd 用来管理服务的命令是 systemctl,启动/查看/停止服务分别用参数选项 start/status/stop。
启动 ssh 服务可以

# systemctl start sshd

要让 ssh 服务自启动可以

# systemctl enable sshd

2.

pacman.conf 有 include 支持包含其他文件的内容。在有多个 Server 的情况下,pacman 优先使用第一个。如果 LZ 并没有把新 Server 放在第一行,pacman  优先使用旧镜像,而旧镜像中并没有 yaourt 包,因此无法获取 pacman。

3.

请给出执行命令。

line 55:exec:xterm:not found

从这行的提示来看,LZ 应该是执行了 startx,但在执行前没有进行过配置,以启动 xfce,因此 startx 使用了预设配置,在这里 startx 尝试启动 xterm 但因为 LZ 并未安装过而失败。
要配置 startx 启动 xfce,
首先执行

$ cp /etc/skel/.xinitrc ~/

然后往 ~/.xinitrc 里添加 exec startxfce4,再 startx
或直接执行

$ xinit /usr/bin/startxfce4

非常非常感谢您的回答,我的问题已经按照你的方法解决了。非常赞您回答问题的方式,很有针对性,而且也是我想要的。您是archlinux使用老手的吗

离线

#10 2015-03-02 22:20:34

liuc
会员
注册时间: 2014-12-29
帖子: 14

Re: 如何查看启动的服务

nopriler 说:

1.
3.
请给出执行命令。

line 55:exec:xterm:not found

从这行的提示来看,LZ 应该是执行了 startx,但在执行前没有进行过配置,以启动 xfce,因此 startx 使用了预设配置,在这里 startx 尝试启动 xterm 但因为 LZ 并未安装过而失败。
要配置 startx 启动 xfce,
首先执行

$ cp /etc/skel/.xinitrc ~/

然后往 ~/.xinitrc 里添加 exec startxfce4,再 startx
或直接执行

$ xinit /usr/bin/startxfce4

昨天按照此法root用户已经成功运行桌面环境。把今天安装了chromium浏览器,但是提示不能以root用户运行。然后就添加了一个普通用户
# useradd -m -g users -s /bin/bash chrome
#passwd chrome
#su chrome
$cd
$cp /etc/skel/.xinitrc ~/
$vi .xinitrc
把exec startxfce4添加到文件末尾。
$startx后的提示信息如下:
/usr/lib/xorg-server/Xorg.wrap: Only console users are allowed to run the X server
Only console users are allowed to run the X server
^Cxinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: unexpected signal 2
Couldn't get a file descriptor referring to the console
疑惑:console users这个是控制台用户的意思吗?要怎么样才能把chrome加入到console users用户组

离线

#11 2015-03-02 22:47:01

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,491
个人网站

Re: 如何查看启动的服务

意思是你需要在 tty 上执行 startx,就是字符界面上最初得到的那个终端。不能在 pty 上。常见的 pty 程序有:各种图形界面上的终端程序、tmux/screen、zhcon/fbterm 等。

离线

页脚