- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
操作系统是Centos7
如何通过命令创建pid文件?
. /etc/rc.d/init.d/functions
#cmd to createin /var/run/example/
daemon --user $USER --pidfile $pidfile "$DAEMON" start
但是没有创建 pid。
有什么建议吗?
最佳答案
--pidfile
用于检查守护进程是否已经运行。在 RHEL(和派生)上,守护进程函数不会写入 pidfile。
您也不能将 $!
与守护进程一起使用来获取 pid。所以你必须执行以下命令从进程列表中获取 pid
ps -ef | grep -v grep | grep YOUR_PROCESS_NAME | awk '{ print $2 }' > pidfile
如果你想使用守护进程。
您还可以使用其他工具,例如 this这将生成 pid 文件。
关于linux - 创建 Linux Pidfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37597369/
我阅读了许多init.d脚本,并且: pid=`cat $pidfile` 台词使我难过。我不明白为什么人们不使用: read pid <$pidfile 最后一个示例使用符合POSIX的语法,并且不
我不清楚 pid 文件的需求和用法,我想知道什么是 pid 文件的正确用法以及围绕它的最佳实践是什么。 最佳答案 在 Linux 中,通常在/var/run 中列出了所有当前正在运行的进程的 pid
操作系统是Centos7 如何通过命令创建pid文件? . /etc/rc.d/init.d/functions #cmd to createin /var/run/example/ daemon -
celeryd不需要pidfile,但celerybeat好像。有什么办法可以禁用它吗?我正在使用 Upstart 来管理进程,因此使用 pidfile 是多余的。 最佳答案 以下似乎对一些人有用,所
我似乎已经尝试了这里的所有解决方案,但似乎都没有用,我不确定我遗漏了什么。我正在尝试通过我的 docker 容器将 celery 作为守护进程运行。 root@bae5de770400:/itapp/
上一小时我使用 cassandra 没有问题,但现在我无法访问 cassandra,当我运行 cqlsh 它给了我这个: Connection error: Could not connect to
环境:Ubuntu 16.04,用 c 编写的守护进程,使用 systemd 进行进程管理。 所以我的单元文件是: [Unit] Description=Fantastic Service After
我有经典的情况。 CentOS7上需要为memcached配置monit。问题是,我在谷歌中可以找到的所有配置都包含这一行: check process memcached with pidfile
我有多个 systemd 文件启动不同的容器。我想用 After= 添加依赖对于一个干净的初创公司。所以我需要用 PIDFile 配置 systemd 来跟踪容器的状态。 使用 podman gene
我在重新构建和重新启动时遇到此问题 cookiecutter-django docker-compose在生产中。我可以通过删除所有已停止的 docker 容器或添加 rm -f './celeryb
在 ubuntu (14.04) 上停止守护程序时删除 pidfile 时遇到问题。 我启动守护进程: log_daemon_msg "Starting $DAEMON_NAME" start-sto
我想用 FastCGI 运行我的 Django sitw。 我可以通过以下命令成功启动TCP服务器。 python manage.py runfcgi method=prefork host=127.
我在两种情况下都问:技术上和风格上。 我的应用程序/守护程序可以在 /opt/my_app/run/ 中保留一个 pidfile 吗? 这样做很糟糕吗? 我的需要是:我的守护程序在特定用户下运行,实现
在运行 celery 时,使用以下命令创建两个我不想要的文件 w1.log 和 w1.pid。 celery multi start w1 -A destiPak.celery -l info 输出
应用程序包括:- Django - 雷迪斯- celery - docker - Postgres 在将项目合并到 docker 中之前,一切都运行良好,但是一旦将其移入容器中,就开始出现问题。一开始
我正在尝试在我的 Debian Wheezy 系统上创建一个服务。 当尝试使用 start-stop-daemon 运行 autossh 时,pid 文件中包含的 pid 与 autossh 进程不匹
我已经根据 this 将我的 Airflow 设置配置为与 systemd 一起运行.好几天了,但它抛出了一些我不知道如何修复的错误。运行 sudo systemctl start airflow-w
我在我的 ec2 linux 实例上通过 screen 运行我的 app.js( Node js 应用程序)。我正在尝试配置我的 monitrc 文件,我需要应用程序 pidfile。它不在:/var
我是一名优秀的程序员,十分优秀!