我正在使用CoreOS来安排系统单元与车队。 我有两个单元( firehose.service和firehose-announce.service 。我试图让firehose-announce.service启动并停止与firehose.service 。下面是firehose-announce.service的单元文件: [Unit] Description=Firehose etcd announcer BindsTo=firehose@%i.service After=firehose@%i.service Requires=firehose@%i.service [Service] EnvironmentFile=/etc/environment TimeoutStartSec=30s ExecStartPre=/bin/sh -c 'sleep 1' ExecStart=/bin/sh -c "port=$(docker inspect -f '{{range $i, $e := .NetworkSettings.Ports }}{{$p := index $e 0}}{{$p.HostPort}}{{end}}' firehose-%i); echo -n \"Adding socket $COREOS_PRIVATE_IPV4:$port/tcp to /firehose/upstream/firehose-%i\"; while netstat -lnt | grep :$port >/dev/null; do etcdctl set /firehose/upstream/firehose-%i $COREOS_PRIVATE_IPV4:$port –ttl […]
在我的情况下,我想在所有glusterfs完全启动后启动remote-fs单元。 我的系统文件: glusterfs目标: node04:/usr/lib/systemd/system # cat glusterfsd.service [Unit] Description=GlusterFS brick processes (stopping only) After=network.target glusterd.service [Service] Type=oneshot ExecStart=/bin/true RemainAfterExit=yes ExecStop=/bin/sh -c "/bin/killall –wait glusterfsd || /bin/true" ExecReload=/bin/sh -c "/bin/killall -HUP glusterfsd || /bin/true" [Install] WantedBy=multi-user.target remote-fs目标: node04:/usr/lib/systemd/system # cat remote-fs.target [Unit] Description=Remote File Systems Documentation=man:systemd.special(7) Requires=glusterfsd.service After=glusterfsd.service remote-fs-pre.target DefaultDependencies=no Conflicts=shutdown.target [Install] WantedBy=multi-user.target 好的,所有Gluster守护进程开始成功,我想通过NFS安装Gluster文件系统,但Gluster的NFS共享在glusterfs.service启动后不会立即准备好,但是几秒钟后,所以通常remote-fs甚至无法安装它,和After指令。 我们来看看日志: Apr […]
我很难搞清楚如何删除不再有文件的systemd单元。 他们似乎仍然在某种程度上在系统中徘徊。 旧的破碎单位,我想删除: core@ip-172-16-32-83 ~ $ systemctl list-units –all firehose-router* UNIT LOAD ACTIVE SUB DESCRIPTION <E2><97><8F> [email protected] not-found failed failed [email protected] <E2><97><8F> [email protected] not-found failed failed [email protected] LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, ie generalization of SUB. SUB = The low-level unit activation state, […]
我不想通过创build一个新的systemd脚本来做正确的事情,我只想让我的旧的init脚本再次工作,现在我已经升级了我的系统到一个使用systemd的操作系统。 我已经简要地研究了如何转换init脚本以及如何编写systemd脚本,但是我确定正确地学习它,如果做正确的话需要花费我几个小时。 目前的情况是: systemctl start solr Failed to start solr.service: Unit solr.service failed to load: No such file or directory. 和: sudo service solr start Failed to start solr.service: Unit solr.service failed to load: No such file or directory. 现在,我只想回去工作。 阻碍再次获得这个工作的path是什么? 更新 我不想弄清楚这一切 – 我真的没有 – 但我必须和我已经发掘了我的第一个线索: sudo systemctl enable solr Synchronizing state for solr.service […]
在我的一台服务器上,我发现真的延迟了SSHlogin。 使用ssh -vvv选项进行连接时,在debug1: Entering interactive session.发生延迟debug1: Entering interactive session. 连接摘录: debug1: Authentication succeeded (publickey). Authenticated to IP_REDACTED ([IP_REDACTED]:22). debug1: channel 0: new [client-session] debug3: ssh_session2_open: channel_new: 0 debug2: channel 0: send open debug1: Requesting [email protected] debug1: Entering interactive session. debug2: callback start debug2: fd 3 setting TCP_NODELAY debug3: packet_set_tos: set IP_TOS 0x10 debug2: client_session2_setup: id […]
比方说我写一个mine.service文件。 然后我使用systemctl enable mine.service 。 如果我后来决定编辑mine.service ,我是否必须告诉systemd mine.service已更改? 如果是这样,我该怎么做?
所以,说我开始rsync或cp或任何其他可以长时间运行的命令后,我会从SSH会话断开连接。 这个命令是否继续运行,直到断开连接完成,或者只是被杀死? 总是想知道这一点。
我有一个与systemd Arch Linux系统,我已经创build了我自己的服务。 /etc/systemd/system/myservice.service的configuration服务如下所示: [Unit] Description=My Daemon [Service] ExecStart=/bin/myforegroundcmd [Install] WantedBy=multi-user.target 现在我想为/bin/myforegroundcmd设置一个环境variables。 我怎么做?