Setting up Systemd on Debian in 10 minutes
来源:互联网 发布:linux查看javahome 编辑:程序博客网 时间:2024/06/06 11:43
Recently I've been reading more and more about Systemd. Now, most distros have already moved toSystemd
but I'm using Debian and was stuck withinit
which was the default. Given the recentdiscussion on the Debian mailing lists about migrating tosystemd
as the new default, I was even moreinclined to make the switch now and get used to it before it's forced upon us.
Actually I was really looking forward to it, but as Linux goes I was expecting it to be a pain, so Iwas pleasantly surprised that it only took me 10 minutes and wasn't a hassle at all.
I've decided to document the steps I've taken in case that someone finds it useful.
First some prerequisites, make sure that you've got your system up2date.
sudo apt-get update && sudo apt-get upgrade
Make sure systemd is actually installed (it should be but check anyway):
sudo apt-get install systemd
Before you switch permanently it's recommended that you try a one-time-boot withsystemd
just to seeif everything's okay. Reboot your machine and on the grub screen selected the kernel you wish to bootand presse
. Then at the end of the kernel line add init=/bin/systemd
and boot your machine.If everything is fine continue with making systemd a permanent choice.
The recommended way to replace init with systemd is to install the package systemd-sysv
which takes care of everything.
sudo apt-get install systemd-sysv
Edit /etc/default/grub
and add init=/bin/systemd
at the end of the lineGRUB_CMDLINE_LINUX_DEFAULT
.Save the file and run the following command to update grub:
sudo update-grub2
Reboot and you should be running systemd (use ps aux
and check for PID 1).
One last thing with Debian is to set up peristent logging with systemd's logging component calledjournal.By default journal will log to /run
which is ephemeral meaning the logs will disappear after reboot. The processof making the logs persistent (if you choose to do so) is documented here:/usr/share/doc/systemd/README.Debian
Basically you just need to run this:
install -d -g systemd-journal /var/log/journalsetfacl -R -nm g:adm:rx,d:g:adm:rx /var/log/journal
It's worth noting that you don't have to use journal if you don't want to, it's designed to co-exist with syslog, that'salready running on your system, so you can continue to use that. I personally find journal awesome and wouldrecommend that you at least check it out and see what it brings to the table.
And that's it folks, now go read more stuff about systemd here.
Thanks to babilen
on irc.oftc.net
for taking the time and explaining everything patiently :).
https://denibertovic.com/posts/setting-up-systemd-on-debian-in-10-minutes/
- Setting up Systemd on Debian in 10 minutes
- Setting Up A PXE Install Server For Multiple Linux Distributions and WinPE On Debian Lenny
- Setting Up A High-Availability Load Balancer With HAProxy/Keepalived On Debian Lenny
- Setting Up OpenERP (Odoo) 9 with Nginx on RHEL/CentOS and Debian/Ubuntu
- Installing OpenStack on Ubuntu 12.04 LTS in 10 Minutes
- Setting up Mercurial on Mac
- Setting Up Transmission-Daemon To Use With Remote GUI In Ubuntu And Debian
- Setting up OpenCV in Eclipse
- Setting up Minicom in Ubuntu
- Setting Up Tomcat 5 on Ubuntu 6.06
- Setting up Pinax development environment on Eclipse.
- Setting up Git on CentOS 5 server
- Setting up Telnet server on Ubuntu
- Setting up ccache on android 4.0.3
- Help on setting up internal RTCC
- Setting up bridged OpenVPN on Freebsd
- Setting up wifi hotspot on Ubuntu 13.10
- Setting Up Logrotate on RedHat Linux
- Android studio 2.0 的安装的全程截图,手把手教学,亲自实践。
- 排序算法总结(5)——希尔排序
- boost::noncopyable 分析
- XssAPP开源,Xss跨站脚本攻击测试平台(JAVA开发) BY:WebSOS
- Failed to download samples index, please check your connection and try again
- Setting up Systemd on Debian in 10 minutes
- Permute the array according to the given permutation.
- *leetcode #115 in cpp
- Java web项目代码结构
- leetcode #116 in cpp
- leetcode #117 in cpp
- PHP命名空间(Namespace)的使用详解
- rfs(robot_framewok)的搭建
- leetcode #118 in cpp