可以看出vpnagetd服务是启动起来的。

<>
[berry@berry:practice] ps -elf | grep vpnagentd 5 S root 6716 1553 0 80 0 -
10845 futex_ 21:43 ? 00:00:00 /opt/cisco/anyconnect/bin/vpnagentd 0 S berry
6966 2122 0 80 0 - 1172 pipe_w 21:48 pts/5 00:00:00 grep --color=auto vpnagentd
[berry@berry:practice] ps -elf | grep vpnagentd | grep -v berry 5 S root 6716
1553 0 80 0 - 10845 futex_ 21:43 ? 00:00:00 /opt/cisco/anyconnect/bin/vpnagentd
<>

berry那一条是运行当前命令出现的。
查看当前vpnagentd这个服务所占用的端口号和相关ip地址和pid和服务名称
[berry@berry:practice] sudo netstat -anp | grep 6716 tcp 0 0 127.0.0.1:29754
0.0.0.0:* LISTEN 6716/vpnagentd unix 2 [ ] DGRAM 75522 6716/vpnagentd
利用service+服务名称+start/stop/restart对服务进行启动,停止和重启

(1)一种是可以使用service脚本来调度,如:

service 服务名 start

service 服务名 stop

service 服务名 restart

<>
[berry@berry:practice] service vpnagentd status vpnagentd is stopped
[berry@berry:practice] sudo service vpnagentd start Starting up Cisco
AnyConnect Secure Mobility Client Agent [berry@berry:practice] service
vpnagentd status vpnagentd (pid 7000) is running [berry@berry:practice] service
vpnagentd restart Shutting down Cisco AnyConnect Secure Mobility Client Agent
Starting up Cisco AnyConnect Secure Mobility Client Agent
[berry@berry:practice] service vpnagentd status vpnagentd (pid 7020) is running
<>

(2)一种是直接执行某个服务自己的管理脚本,以vpnagetd服务为例

/etc/init.d/vpnagentd  start

/etc/init.d/vpnagentd stop

/etc/init.d/vpnagentd restart

 

<>
[berry@berry:practice] service vpnagentd status vpnagentd (pid 7393) is
running [berry@berry:practice] sudo /etc/init.d/vpnagentd stop Shutting down
Cisco AnyConnect Secure Mobility Client Agent [berry@berry:practice] service
vpnagentd status vpnagentd is stopped [berry@berry:practice] sudo
/etc/init.d/vpnagentd start Starting up Cisco AnyConnect Secure Mobility Client
Agent [berry@berry:practice] service vpnagentd status vpnagentd (pid 7707) is
running [berry@berry:practice] sudo netstat -anp | grep 7707 tcp 0 0
127.0.0.1:29754 0.0.0.0:* LISTEN 7707/vpnagentd unix 2 [ ] DGRAM 78741
7707/vpnagentd [berry@berry:practice]
<>

端口号仍然是29754。

 

分类: linux <https://www.cnblogs.com/Berryxiong/category/891667.html>

标签: linux服务的启动
<https://www.cnblogs.com/Berryxiong/tag/linux%E6%9C%8D%E5%8A%A1%E7%9A%84%E5%90%AF%E5%8A%A8/>
, 停止和重启一起查看服务所占用的端口
<https://www.cnblogs.com/Berryxiong/tag/%E5%81%9C%E6%AD%A2%E5%92%8C%E9%87%8D%E5%90%AF%E4%B8%80%E8%B5%B7%E6%9F%A5%E7%9C%8B%E6%9C%8D%E5%8A%A1%E6%89%80%E5%8D%A0%E7%94%A8%E7%9A%84%E7%AB%AF%E5%8F%A3/>

友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信