我在启动过程中使用了grub2和systemd(而不是inittab)的centos7启用串行控制台, 为了安全起见,我想在启动完成之后,在引导的最后一次撤销串行input/输出。 我怎样才能做到这一点? 更新: 我发现,通过系统服务,即使grub2启动它,控制台也可以通过它来识别/启用,所以我认为这会closures它。 systemctl stop [email protected] 如果所有其他服务都已联机,则在完全成功启动后,如何自动实现这一function。 我可以使用rc.local但这是init.d的遗产,并没有考虑到其他服务已经正常上网。
我是新来的systemd 。 我有一台机器需要运行大量的守护进程。 有三种types的守护进程,称它们为守护进程A , 守护进程B , 守护进程C。 这些守护进程总是运行在3个“组”中,具有这些3的特定configuration。 偶尔,有必要重新启动或停止整个组。 什么是解释这个systemd最好的方法? 我目前的知识将使我简单地为每个守护进程A , 守护进程B , 守护进程C ,为每个configuration创build一个新的.service文件。 我在cgroups和slice方面稍微有些失落,因为我有点理解他们做了什么,但是实际的用例还是略微超出了我的意思。 我需要能够以简单的方式检查一个特定的组。 这是要走的路吗? 拥有如此大量的systemd managed服务有什么问题吗?
我正在试图在debian jessie上正确设置一个无头 libreoffice / openoffice服务器。 我使用以下内容创build了名为/etc/systemd/system/openoffice.service的脚本 [Unit] Description=OpenOffice service After=syslog.target [Service] ExecStart=/usr/bin/soffice '–accept=socket,host=localhost,port=8101;urp;StarOffice.ServiceManager' –headless –nofirststartwizard –nologo Restart=always KillSignal=SIGQUIT Type=notify StandardError=syslog NotifyAccess=all User=www-data [Install] WantedBy=multi-user.target 我启用它: systemctl enable openoffice.service 我处于只是部分工作的情况: 它在启动时正确启动 如果查询状态systemctl status openoffice.service它clams它仍然激活 如果我尝试启动它只是挂起 我一直无法find一个工作的例子,我也想了解如何创build使用系统的debian /etc/init.d脚本…
有没有办法使用systemd启动服务,并指示它logging到/ dev / null,而不包括单元文件中的适当行。 例如,将StandardOutput和StandardErorr指令设置为null的文件将把日志发送到/ dev / null。 [Unit] Description=MyService [Service] ExecStart=/usr/bin/start_myservice.sh Restart=always StandardOutput=null StandardError=inherit [X-Fleet] Global=true 这项服务可以开始 systemctl start MyService.service 我的问题是,是否有办法启动没有设置StandardOutput和StandardError指令的服务,并强制它的日志去/ dev / null。 也许用像这样的命令 systemctl start OtherService.service –disable-logging
我做了一些search,没有看到类似的问题。 我有一份工作应该每五分钟运行一次。 一次只能有一份工作。 如果程序运行超过5分钟,应立即重新启动,而不是等待。 大多数时候,这项工作将在一分钟内完成,偶尔也要做20分钟的事情。 我目前以systemd服务运行这个工作,而这个工作是一个shell脚本,它在一个循环中调用实际的程序,并在迭代(5分钟 – 上次运行时间)之间hibernate。 它工作很好。 #!/bin/sh # # Sample executable repeat-loop # # Run my job in a loop. If it takes less than max_delay seconds # to run, sleep until it's time to repeat. If, for some reason, it took longer, just start # over again immediately. max_delay=300 # maximum […]
我有Debian Wheezy 。 我错误地安装了systemd。 它似乎没有安装好,但现在它成为默认的初始pipe理器。 我无法重新启动,无法重新启动服务。 apt-get remove systemd dpkg -S /sbin/init tell that sysvinit: /sbin/init是默认的init manager 我如何删除systemd或设置sysvinit是一个默认的?
我有一个系统计时器,我想每个工作日上午5:30运行。 这是.timer文件: [Unit] Description=My Cool Timer [Timer] OnCalendar=Mon-Fri 05:30:00 [Install] WantedBy=timers.target 我昨天晚上设定了这个计时器,并按计划今天上午解雇了。 然而,检查其状态显示,下一次预定的发射(LEFT)是8小时前 : boatzart@machine: sudo systemctl list-timers myCoolTimer.timer NEXT LEFT LAST PASSED UNIT ACTIVATES Thu 2016-09-01 05:30:00 PDT 8h ago Thu 2016-09-01 05:30:00 PDT 8h ago myCoolTimer.timer myCoolTimer.service 我不确定是否重要,但关联的.service文件是Type=forking 。 我如何让我的计时器实际重复?
在subs中 – 我想在a.service启动/重启之后启动/重启b.service。 有没有一个很好的方法来完成这个? 谢谢
在DigitalOcean上升级我的debian(testing,jessie to stretch)服务器之后,MariaDB不会以service mariadb start开始 。 我试图清除所有mariadb- *和mysql- *包,删除configuration和数据,并重新安装它们,但mariadb-server-10.1.21-5拒绝configuration: Setting up mariadb-server-10.1 (10.1.21-5) … Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details. invoke-rc.d: initscript mysql, action "start" failed. ● mariadb.service – MariaDB database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: […]
我正在做一个从Ubuntu 12.04到16.04的暂存和生产服务器有点痛苦的迁移过程。 我正在testing迁移的阶段,它主要是工作,除了让uWSGI在systemd下启动(它以前在Upstart下工作得很好)。 这工作没有问题: uwsgi –ini /etc/uwsgi/my_wsgi.ini 但是运行以下操作不起作用(uWSGI不启动,但不会产生错误): sudo systemctl start uwsgi 我在/etc/systemd/system/uwsgi.service中创build了以下服务: [Unit] Description=uWSGI Service [Service] ExecStart=/usr/local/bin/uwsgi –ini /etc/uwsgi/my_wsgi.ini Restart=always RestartSec=5 KillSignal=SIGQUIT Type=notify NotifyAccess=all [Install] WantedBy=multi-user.target 和my_wsgi.ini具有以下内容: [uwsgi] # Django-related settings # the base directory (full path) chdir = /path/to/project/hidden # Django's wsgi file module = wsgi # process-related settings # master master = […]