CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了centos – 使用systemd启动程序大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我正在尝试将最新版本的ProFTPd(1.3.5)安装到CentOS 7盒子上,并且需要手动配置和安装.原因是EPEL的proftpd版本不包括mod_sftp(尽管它包含mod_tls).这是安装EPEL版本时proftpd -l的输出: [root@blah /]# proftpd -l Compiled-in modules: mod_core.c mod_xfer.c mod_
我正在尝试将最新版本的ProFTPd(1.3.5)安装到CentOS 7盒子上,并且需要手动配置和安装.原因是EPEL的proftpd版本不包括mod_sftp(尽管它包含mod_tls).这是安装EPEL版本时proftpd -l的输出
[root@blah /]# proftpd -l
Compiled-in modules:
  mod_core.c
  mod_xfer.c
  mod_rlimit.c
  mod_auth_unix.c
  mod_auth_file.c
  mod_auth.c
  mod_ls.c
  mod_log.c
  mod_site.c
  mod_delay.c
  mod_facts.c
  mod_dso.c
  mod_ident.c
  mod_readme.c
  mod_auth_pam.c
  mod_tls.c
  mod_memcache.c
  mod_cap.c
  mod_ctrls.c
  mod_lang.c

Using this guy’s method where I think he was using CentOS 6,我用以下内容配置了proftpd:

./configure --prefix=/usr --with-includes=/usr/local/ssl/include --with-libraries=/usr/local/ssl/lib --enable-openssl --with-modules=mod_sftp --enable-dso

然后我就能成功运行make和make install.

问题是它看起来不像创建任何系统脚本:

[root@localhost]# systemctl start proftpd.service
Failed to issue method call: Unit proftpd.service Failed to load: No such file or directory.

但是,二进制存在,系统知道它:

[root@localhost]# which proftpd
/sbin/proftpd

此外,在/etc/init.d和/usr/etc/init.d中似乎没有任何init脚本.

当我独自运行二进制站时,它就可以了.

但是我希望得到一些工作的init或systemd脚本为此工作,以便它将在启动时启动(我将有一个更容易的时间来管理服务).

有关如何做到这一点的任何想法?

[免责声明:我几天前在Stack Overflow上发布了同样的问题,认为这是一个更加以编程为中心的问题,但是没有看到任何活动,我认为这与系统管理相关,其相关性在这里太]

systemd单元看起来像这样:
$cat /etc/systemd/system/proftpd.service

[Unit]
Description=ProFTPd FTP Server
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/usr/sbin/proftpd
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

然后你可以这样做:

$sudo systemctl enable /etc/systemd/system/proftpd.service
$sudo systemctl start proftpd.service

man systemctl应该让你走上正轨.

大佬总结

以上是大佬教程为你收集整理的centos – 使用systemd启动程序全部内容,希望文章能够帮你解决centos – 使用systemd启动程序所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: