AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[startup](server)

Martin Hope
Marty Cagas
Asked: 2022-03-05 04:41:47 +0800 CST

Postfix 在使用 systemctl 启用其服务并且不会在启动时启动时会导致问题

  • 1

在Rocky Linux 8.5 版机器(下游兼容 bug-for-bug 的 Red Hat Enterprise Linux)上,我配置了 Postfix + Dovecot 设置。在对所有配置错误进行故障排除后,我到了至少可以启动这两个服务的地步。

systemctl enable dovecot.service
systemctl enable postfix.service

重启机器后,我可以看到 Dovecot 在使用systemctl status dovecot. 另一方面,Postfix 无法启动,报告:

[root@mail ~]# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since ...; 12min ago
  Process: 1419 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)
  Process: 1396 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
  Process: 1364 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)

systemd[1]: Starting Postfix Mail Transport Agent...
postfix/postfix-script[1506]: fatal: the Postfix mail system is already running
systemd[1]: postfix.service: Control process exited, code=exited status=1
systemd[1]: postfix.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Postfix Mail Transport Agent.

使用快速检查postfix status表明它确实没有运行。但令人惊讶的是,postfix start然后启动服务没有任何问题。查询postfix status然后报告 Postfix 正在使用新的 PID 愉快地运行。之后再查询systemctl status postfix一次,显示与之前相同的错误报告。

但是,报告的错误没有意义。我可以systemctl disable postfix,重新启动机器,检查 Postfix 是否真的没有同时使用,systemctl status postfix然后postfix status尝试启用它systemctl start postfix并得到相同的错误。

此外,如果我在 systemd 中禁用 Postfix 服务,重新启动机器并仅使用 启动它postfix start,该服务将启动,但systemctl status postfix报告它已加载、不活动...

[root@mail ~]# postfix start
postfix/postfix-script: starting the Postfix mail system
[root@mail ~]# postfix status
postfix/postfix-script: the Postfix mail system is running: PID: 2169
[root@mail ~]# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@mail ~]#

为什么 RHEL 上的 Postfix 在它断然拒绝这样工作时甚至注册为服务?那么确保 Postfix 在引导时启动的正确方法是什么?

注意:我试过chkconfig postfix on了,因为我发现网上有人建议。这只是转发了systemctl enable postfix.service让我回到开始的请求。

...我真的必须破解它 using /etc/rc.local,当文件本身的内容说它只是为了兼容性目的而存在时,不应该再使用并且我应该考虑使用 systemd 服务?

更新 1:我暂时采用了一种看似合理的解决方法 -postfix start使用/etc/rc.local. 重新启动后,Postfix 仍然没有运行。使用 查看rc-local服务的状态,systemctl status rc-local服务启动失败,日志中的原因和我启用后的postfix服务日志中的原因一模一样systemctl——“fatal:postfix邮件系统已经跑步”。Postfix 在所有情况下都无法在启动时启动。

postfix startup systemd rhel8 rocky-linux
  • 1 个回答
  • 1400 Views
Martin Hope
Mark Deven
Asked: 2020-12-17 18:33:34 +0800 CST

以具有 root 权限的用户身份运行脚本

  • 1

由于挂载的驱动器上的权限冲突且不断变化(由于程序的开发结构而无法轻易解决),因此必须使用root权限运行脚本。

这可以完成sudo /usr/serverm1/lsintd并提供良好的结果。但是,我们希望在启动时自动运行此脚本。

由于权限不足,在启动时在我们的主用户下运行脚本会导致核心转储。因此,我们认为我们可以在 crontab 中将其设置为@reboot /usr/serverm1/lsintd(如此处所建议的,但是这会使用 root 的设置和配置运行它(这是不存在的)。

TLDR:我们如何才能像在启动时使用命令一样运行脚本sudo /usr/serverm1/lsintd?

我也尝试应用chmod u+x到二进制文件,但是这仍然会导致核心转储,就像使用常规权限运行一样(想法来自让用户运行具有 root 权限的脚本)。

旁注:我承认这在某种程度上是一个 XY 问题,但是由于我们服务器上一些其他服务的开发结构缓慢且组织不良,我们无法解决根本问题,必须解决这个问题。

linux root startup linuxmint startup-scripts
  • 1 个回答
  • 1232 Views
Martin Hope
Index
Asked: 2020-10-30 01:18:51 +0800 CST

SVN 服务器开机启动

  • 0

我正在配置 Subversion 并希望它在启动时启动。使用以下命令系列:

sudo mkdir /var/svn
sudo useradd -r -s /bin/false svn
sudo mkdir /etc/svn
sudo cp /home/zipo/svnserve /etc/svn/svnserve
sudo chown root:root /etc/svn/svnserve
set execute to owner/group/other
sudo nano /lib/systemd/system/svn.service
sudo systemctl daemon-reload
sudo systemctl enable svn
sudo systemctl start svn

当我在 syslog 中键入手动命令以启动服务sudo systemctl start svn时,会出现以下日志条目:

    Oct 29 10:13:27 testserver systemd[1]: Started SVN server.
    Oct 29 10:13:27 testserver svnserve[3128]:  * Starting svnserve...
    Oct 29 10:13:27 testserver svnserve[3128]:    ...done.

但服务不起作用。我在正确的端口 9999 上检查它,如配置中所述。如果我使用以下命令手动运行它,它会启动并正常工作:sudo -H -u svn bash -c '/etc/svn/svnserve start'

我错过了什么?

svn.service 文件内容:

    [Unit]
    Description=SVN server
    After=network.target

    [Service]
    User=svn
    Group=svn
    Type=simple
    ExecStart=/etc/svn/svnserve start
    GuessMainPID=no

    [Install]
    WantedBy=multi-user.target

svnserve 文件内容:

    #! /bin/sh -e
    #
    # svnserve - brings up the svn server so anonymous users
    # can access svn
    #

    # Get LSB functions
    . /lib/lsb/init-functions
    . /etc/default/rcS

    SVNSERVE=/usr/bin/svnserve
    SVN_USER=svn
    SVN_GROUP=svn
    SVN_REPO_PATH=/var/svn/

    # Check that the package is still installed
    [ -x $SVNSERVE ] || exit 0;

    case "$1" in
            start)
                    log_begin_msg "Starting svnserve..."
                    umask 002
                    if start-stop-daemon --start \
                    --chuid $SVN_USER:$SVN_GROUP \
                    --exec $SVNSERVE \
                    -- -d --listen-port=9999 -r $SVN_REPO_PATH; then
                            log_end_msg 0
                    else
                            log_end_msg $?
                    fi
            ;;

            stop)
                    log_begin_msg "Stopping svnserve..."
                    if start-stop-daemon --stop --exec $SVNSERVE; then
                    log_end_msg 0
                    else
                    log_end_msg $?
                    fi
            ;;

            restart|force-reload)
                    "$0" stop && "$0" start
            ;;

            *)
            echo "Usage: /etc/init.d/svnserve {start|stop|restart|force-reload}"
                    exit 1
            ;;
    esac

    exit 0
svn startup systemd
  • 1 个回答
  • 785 Views
Martin Hope
Isidius
Asked: 2016-08-27 03:11:36 +0800 CST

防止Apache2在错误日志中写入启动信息

  • 0

Apache2 总是将启动信息写入错误日志。请参阅以下输出:

[Fri Aug 26 12:57:54.298895 2016] [ssl:warn] [pid 4287] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Aug 26 12:57:54.326885 2016] [mpm_prefork:notice] [pid 4287] AH00163: Apache/2.4.10 (Linux/SUSE) OpenSSL/1.0.1k-fips PHP/5.6.1 configured -- resuming normal operations
[Fri Aug 26 12:57:54.326943 2016] [core:notice] [pid 4287] AH00094: Command line: '/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D CACTI -D SYSTEMD -D FOREGROUND'

我如何配置 apache2 来阻止它,因为它让webmin感到困惑,它认为虽然它成功启动了,但它没有..

我在任何配置文件中都没有设置

LogLevel debug|trace
startup apache-2.4 apache2 mpm-prefork
  • 3 个回答
  • 1012 Views
Martin Hope
Blagus
Asked: 2016-01-16 02:51:52 +0800 CST

Tomcat7 - 启动缓慢

  • 1

我对Tomcat7的启动时间很长有疑问。

它突然启动,日志没有显示任何内容 - 当我输入“sudo service tomcat7 start”时,它说好的并且日志静默 10-15 分钟。

然后我的应用程序日志说:

INFO [2016-01-14 17:38:36,336] (FrameworkServlet.java:initServletBean:463) - FrameworkServlet 'Spring MVC Dispatcher Servlet':初始化在 28862 毫秒内完成

28 秒显然不是真的,我不知道它挂在哪里,因为日志什么也没说。

问题不在于熵,因为我不将它用于任何事情,此外,我已经做了与解决该问题相关的所有事情,以防万一。

编辑:我刚刚发现实际上是 .war 部署需要很长时间。我尝试使用旧版本的应用程序,但没有帮助。

startup
  • 2 个回答
  • 691 Views
Martin Hope
DASKAjA
Asked: 2014-10-17 08:44:44 +0800 CST

自动启动 docker 容器的链接依赖

  • 5

我在docker 容器中运行 gitlab,它将其依赖项(MySQL、Redis、Mailserver)很好地分离到单独的 docker 容器中。运行它们不是问题,我以相反的顺序启动它们:首先是依赖项,然后是 gitlab 本身。

有时我必须重新启动 docker 主机。目前我 ssh 进入 docker 主机并手动重启容器。有更好的方法吗?就像只是告诉一些服务启动 gitlab 容器并首先启动它的依赖项?我知道我可以为每个 docker 容器创建单独的初始化脚本,但这不是我想要的。

startup
  • 3 个回答
  • 7602 Views
Martin Hope
Alex
Asked: 2014-08-22 05:18:54 +0800 CST

Centos 7. 由于优先级,Freeradius 无法在启动时启动

  • 6

我在搞乱FreeRADIUS,MySQL (MariaDB)似乎 FreeRADIUS 服务在启动时无法正常启动。但它使用root用户或调试模式 ( radiusd -X) 可以正常启动并且工作正常!调试模式显示没有错误。

systemctl命令显示 radiusd.service 无法启动。

/var/log/messages 输出:

Aug 21 15:52:29 nexus-test systemd: Starting The Apache HTTP Server...
Aug 21 15:52:29 nexus-test systemd: Starting MariaDB database server...
Aug 21 15:52:29 nexus-test systemd: Starting FreeRADIUS high performance RADIUS server....
Aug 21 15:52:29 nexus-test systemd: Started OpenSSH server daemon.
Aug 21 15:52:29 nexus-test mysqld_safe: 140821 15:52:29 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Aug 21 15:52:29 nexus-test mysqld_safe: 140821 15:52:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Aug 21 15:52:30 nexus-test systemd: Started Postfix Mail Transport Agent.
Aug 21 15:52:30 nexus-test avahi-daemon[604]: Registering new address record for fe80::250:56ff:fe85:e4af on eth0.*.
Aug 21 15:52:30 nexus-test systemd: radiusd.service: control process exited, code=exited status=1
Aug 21 15:52:30 nexus-test systemd: Failed to start FreeRADIUS high performance RADIUS server..
Aug 21 15:52:30 nexus-test systemd: Unit radiusd.service entered failed state.
Aug 21 15:52:31 nexus-test kdumpctl: kexec: loaded kdump kernel
Aug 21 15:52:31 nexus-test kdumpctl: Starting kdump: [OK]
Aug 21 15:52:31 nexus-test systemd: Started Crash recovery kernel arming.
Aug 21 15:52:31 nexus-test systemd: Started The Apache HTTP Server.
Aug 21 15:52:31 nexus-test systemd: Started MariaDB database server.

/var/log/radius/radius.log 输出:

Thu Aug 21 15:24:16 2014 : Info: rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
Thu Aug 21 15:24:16 2014 : Info: rlm_sql (sql): Attempting to connect to database "radius"
Thu Aug 21 15:24:16 2014 : Info: rlm_sql (sql): Opening additional connection (0)
Thu Aug 21 15:24:16 2014 : Error: rlm_sql_mysql: Couldn't connect socket to MySQL server radius@localhost:radius
Thu Aug 21 15:24:16 2014 : Error: rlm_sql_mysql: Mysql error 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Thu Aug 21 15:24:16 2014 : Error: rlm_sql (sql): Opening connection failed (0)
Thu Aug 21 15:24:16 2014 : Error: /etc/raddb/mods-enabled/sql[47]: Instantiation failed for module "sql"

看到这个后,我尝试复制问题,杀死mariadb.service并再次开始运行调试模式。它吐出与radius.log.

我尝试禁用iptables并firewalld重新启动,但没有运气:

systemctl disable iptables
systemctl disable firewalld

因此,问题可能出在进程启动顺序或某种延迟上。也许 FreeRADIUS 的 SQL 模块无法连接到尚未启动的 MariaDB?如果是,我该如何解决这个问题?

在早期版本的 RHEL/CENTOS 中,我知道你很容易看到服务启动顺序,比如 rc.d 或其他东西,现在是 IDK。我对 Centos 7 引入的这个花哨的“systemd”、“systemctl”、“firewalld”东西很陌生,很抱歉我有点困惑。还有这个新FreeRADIUS 3结构...

PS。MariaDB 在启动时启用,FR DB 配置中的凭据正确


一点更新:

cat /etc/systemd/system/multi-user.target.wants/radiusd.service输出:

[Unit]
Description=FreeRADIUS high performance RADIUS server.
After=syslog.target network.target

[Service]
Type=forking
PIDFile=/var/run/radiusd/radiusd.pid
ExecStartPre=-/bin/chown -R radiusd.radiusd /var/run/radiusd
ExecStartPre=/usr/sbin/radiusd -C
ExecStart=/usr/sbin/radiusd -d /etc/raddb
ExecReload=/usr/sbin/radiusd -C
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
startup
  • 2 个回答
  • 27131 Views
Martin Hope
netadmin2008
Asked: 2012-08-15 04:57:14 +0800 CST

缺少所有用户的启动文件夹,有没有办法激活一个?

  • 2

此路径下缺少所有用户配置文件启动程序文件夹。工作站运行的是 Windows 7。 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

有没有办法创建一个在这个路径地方工作的方法?

它可能已被组策略删除,但直到我们发现我正在寻找替代修复程序。

谢谢你。

startup
  • 2 个回答
  • 2633 Views
Martin Hope
Jader Dias
Asked: 2010-04-16 05:30:50 +0800 CST

Windows Server 2008登录时如何防止出现服务器管理器?

  • 1

我几乎从不使用这个应用程序,它总是在我登录时打开。

windows windows-server-2008 startup
  • 1 个回答
  • 361 Views
Martin Hope
user924
Asked: 2010-04-06 11:23:35 +0800 CST

查看启动时运行的文件(linux)

  • 1

在我 ssh 进入机器后,如何检查运行了哪些启动脚本?

linux scripting startup
  • 2 个回答
  • 128 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve