systemd

How to run nginx.service after /vagrant is mounted

对着背影说爱祢 提交于 2019-12-03 14:41:08
问题 What I want to do? I'm trying to make nginx load configurations from /vagrant mounted by vagrant automatically. So I edited nginx.service to make it boot after shared folder mounted, but it not works. Certainly nginx has been booted after virtualbox-guest-utils.service, however, it seems to be booted before vagrant.mount (/vagrant). Because nginx couldn't load configurations from /vagrant and it works after running command systemctl restart nginx.service manually. How to run .service unit

Linux学习之路-Linux-at及cron命令【7】---20171215

痴心易碎 提交于 2019-12-03 13:22:49
Linux学习之路-Linux-at及cron命令【7】---20171215 DannyExia00 0 人评论 986人阅读 2017-12-24 17:28:03 ntpdate 命令 [root@Centos6~]#ntpdate 172.18.0.1 -------->ntpdate 命令跟服务器同步时间 18 Dec 21:16:25 ntpdate[7932]: step time server 172.18.0.1 offset 412750.511124 sec [root@Centos6~]#date 2017年 12月 18日 星期一 21:16:35 CST [root@Centos6~]#ll /usr/bin/at -rwsr-xr-x. 1 root root 54464 3月 22 2017 /usr/bin/at -------->具有SUID权限 cron 命令 周期性任务计划:cron 相关的程序包: cronie: 主程序包,提供crond守护进程及相关辅助工具 Cronie包含在预定时间运行指定程序的标准UNIX守护进程crond和相关工具。 它是原来的vixie-cron的一个分支,并具有像使用pam和SELinux一样的安全和配置增强功能 cronie-anacron:cronie的补充程序,用于监控cronie任务执行状况

sd_notify() from Java

我们两清 提交于 2019-12-03 13:20:27
I have a Java service (implemented using Dropwizard ) which I'm launching from a user instance of systemd . So far so good. Now I would like to use systemd's notification features to make it aware of the service state (available as a C library function or shell script but eventually both methods talk to a socket referenced by an environment variable). I can run arbitrary code when the service has finished starting up, but I'm not sure how best to notify systemd from within Java. Other developers run this service on Windows, so for bonus points it would be really useful if my notification code

systemd: “Environment” directive to set PATH

你。 提交于 2019-12-03 10:05:31
What is the right way to set PATH variable in a systemd unit file? After seeing a few examples, I tried to use the format below, but the variable doesn't seem to expand. Environment="PATH=/local/bin:$PATH" I am trying this on CoreOS with the below version of systemd. systemd 225 -PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT -GNUTLS -ACL +XZ -LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN You can't use EnvVars in Environment directives. The whole Environment= will be ignored. If you use EnvironmentFile= , then the specified file will be loaded without substitution.

Linux把程序设置成服务运行

假装没事ソ 提交于 2019-12-03 09:46:36
在linux下,把程序设置systemctl服务,并开机启动。以nexus服务为例:进入usr/lib/systemd/system/目录 新建nexus.service文件,写入如下内容, 字段说明请百度systemctl服务的字段说明。 以nexus服务为例: 进入/usr/lib/systemd/system, 新建nexus.service文件,写入如下内容, 字段说明请百度systemctl服务的字段说明。 …… [Unit] Description=Nexus After=network.target remote-fs.target nss-lookup.target [Service] Type=forking Environment="JAVA_HOME=/usr/java/jdk1.8.0_144" ExecStart=/usr/local/nexus/nexus-3.7.1-02/bin/nexus start ExecStop=/usr/local/nexus/nexus-3.7.1-02/bin/nexus stop [Install] WantedBy=multi-user.target 保存退出,输入:systemctl reload *.service #重新加载服务配置文件。然后就可以启动服务了, systemctl start nexus

Start a service in docker container failed,with error: Failed to get D-Bus connection: No connection to service manager

馋奶兔 提交于 2019-12-03 09:45:06
问题 I installed docker image and built a image successfully. When I ssh to the container and run the command service xxx start , an error popped: service nginfra start Redirecting to /bin/systemctl start nginfra.service /sbin/service: line 79: /bin/systemctl: No such file or directory Actually, fakesystemd is installed in the container instead of systemd . So I removed fakesystemd and installed systemd with the command: yum swap -- remove fakesystemd -- install systemd systemd-libs But I still

debian系列systemd 配置nodejs服务

限于喜欢 提交于 2019-12-03 09:31:27
1 新建service配置文件   vi /etc/systemd/system/node.service [Unit] Description=My super nodejs app [Service] # set the working directory to have consistent relative paths WorkingDirectory=/home/root/Heroku/ # start the server file (file is relative to WorkingDirectory here) ExecStart=/usr/bin/node /home/root/Heroku/server.js # if process crashes, always try to restart Restart=always # let 500ms between the crash and the restart RestartSec=500ms # send log tot syslog here (it doesn't compete with other log config in the app itself) StandardOutput=syslog StandardError=syslog # nodejs process name in

pactl called from systemd service always reports “pa_context_connect() failed connection refused”

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I've setup a systemd service file to perform some pactl operations at system startup for a test process. While the commands work fine when performed from a terminal I always get "pa_context_connect() failed connection refused" when running the same script from the systemd service by starting the service. I'm also using the 'User=' directive in the service file to ensure that the auto-login user matches the user used to run the service commands. I've read that this is somehow related to the pulseaudio session not being valid in the

what does fd:// mean exactly in dockerd -H fd://

匿名 (未验证) 提交于 2019-12-03 08:39:56
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Docker daemon documentation suggests the following hosts option for most setups: dockerd -H fd:// I guess fd stands for file descriptor. I don't understand how fd is used for socket communication. I understand the following options: -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2 These are unix domain sockets and tcp sockets. I know how to call docker daemon using these sockets: docker -H tcp://0.0.0.0:2375 ps But if I started docker daemon using -H fd:// , the following call gives error: $ docker -H fd:// ps error

Ubuntu 16.04 systemd redis issues with ulimit

徘徊边缘 提交于 2019-12-03 06:53:07
问题 I have been having issues with our new redis server after swapping from Ubuntu 14.04 to 16.04. The configuration of the open files limit using all the guides says to change the /etc/security/limits.conf with the following settings * soft nofile 65535 * hard nofile 65535 root soft nofile 65535 root hard nofile 65535 And also to add to /etc/pam.d/common-session and /etc/pam.d/common-session-noninteractive session required pam_limits.so I have made all of these changes but redis is still