20. Feature systemd sysvinit upstart initng
Service files
Uses .service files
to describe
services
Uses shell scripts
in .
/etc/init d/ to
control services
Uses .conf files to
configure services
Uses .ng files to
define services
and
dependencies
Dependenc
y
Parallelizes
service start-up
through
dependencies
Sequentially starts
services based on
rc runlevels
Uses event-based
dependencies to
start services
Uses parallel
initialization for
faster boot times
Logging
Uses journald for
centralized
logging
Sends logs to
syslog
Sends logs to
syslog
Sends logs to
syslog
Compatibilit
y
Supports
compatibility with
SysV scripts and
init files
Maintains
compatibility with
SysV scripts and
runlevels
Compatible with
,
SysV scripts
,
runlevels and LSB
headers
Not designed for
SysV compatibility
Feature systemd sysvinit upstart initng
Init system Yes Yes Yes Yes
Parallel booting Yes No Yes Yes
Service
management
,
Yes with systemd units
,
Yes with
init scripts
,
Yes with
upstart jobs
,
Yes with
runscripts
Socket activation Yes No Yes Yes
Journaling ,
Yes with journald No No Yes
System state
tracking
,
Yes with systemd-inhibit No No No
Systemd-resolved
,
Yes provides DNS caching and
network name resolution
No No No
21. Feature systemd sysvinit upstart initng
Cgroup support Yes No No Yes
Btrfs support
,
Yes includes support for Btrfs
subvolumes and snapshots
No No No
Snap support ,
Yes with snapd No No No
DBus activation Yes No Yes No
Boot time
configuration
,
Yes with systemd-firstboot No No No
39. مفهوم میبایستی ما هرچیز از قبل
init
و
runlevel
: کنیم بررسی را ها
کرنل اینکه از بعد
Boot
نام به برنامه یک همیشه شود می
init
اجرای از بعد .کند می اجرا را
init
تنظیماتی برنامه این
نام به فایل یک داخل از را دهد انجام باید که
inittab
مسیر در فایل این که کند می اجرا و خواند می
//
etc//inittab
داخلی ساختار با باید شوید لینوکس دنیای وارد خواهید می که شخصی عنوان به شما .است گرفته قرار
شوید آشنا فایل این تنظیمات کاری نحوه و
برای متفاوتی های ساختار ما : نکته
System and Service Manager
: جمله از داریم را
,
upstart
, ,
sysvinit systemd initng
. باشد می زیر قرار به ها ساختار این شرح کلی بطور که
Init
In Unix-based computer operating systems, init (short for initialization) is the first process
started during booting .
of the computer system Init is a daemon process that continues
.
running until the system is shut down It is the direct or indirect ancestor of all other
processes and automatically adopts all orphaned processes. Init is started by the kernel
during the booting process; a kernel panic .
will occur if the kernel is unable to start it Init
is typically assigned process identifier 1.
In Unix systems such as System III and System V, the design of init has diverged from the
functionality provided by the init in Research Unix and its BSD .
derivatives Up until
,
recently most Linux distributions employed a traditional init that is somewhat
compatible with System ,
V while some distributions such as Slackware use BSD-style
,
startup scripts and others such as Gentoo .
have their own customized versions
یا ها موجودیت اکثر
entry
در که هایی
inittab
می استفاده زیر مشابه مشخص ساختار و قالب یک از دارد وجود
: کنند
: : :
id runlevels action process
43. Initng is a full replacement of the UNIX System V init, the first process spawned by the
kernel in Unix-like computer operating systems, which is responsible for the initialization
. .
of every other process Initng's website calls initng "The next generation init system"
44. Upstart is an event-based replacement for the traditional init daemon – the method by
which several Unix-like computer operating systems perform tasks when the computer is
.
started It was written by Scott James Remnant, a former employee of .
Canonical Ltd
46. The systemd software suite provides fundamental building blocks for a Linux operating
system. 6
[ ] ,
It includes the systemd "System and Service Manager" 7
[ ] an init system used
to bootstrap user space and manage user processes. The name systemd adheres to the
Unix convention of naming daemons by appending the letter .
d 8
[ ] It also plays on the
term "System D ,
" which refers to a person's ability to adapt quickly and improvise to solve
.
problems 9
[ ]
It aims to unify service configuration and behavior across Linux distributions. 10
[ ] It
replaces the UNIX System V and BSD . 2015,
init systems Since the majority of Linux
.
distributions have adopted systemd 11
[ ] 1
[ ]
در ما
sysvinit
نام به فایلی
.
rc local
این . دارد را آن در . شده داده خای اسکریپت و دستورات اجر وظیفه که داریم
در ساختار
systemd
. پرداخت خواهیم آن بررسی به آموزش این در ما که . کرد فعال توان می
در شما : نکته
systemd
مستقل بصورت میتوانید
unit
. اجرا برای کنید ایجاد تارگت و
: میدهیم انجام را زیر مراحل قابلیت این کردن فعال برای حال
در ما
systemd
نام به سرویسی
rc-local
حتی یا کنیم بررسی را آن وضعیت اگر حال . داریم را
start
کنیم
. نمیشود فعال و است روبرو مشکل با میبینیم
systemctl status rc-local
. .
● rc-local service - /etc/rc local Compatibility
: . :
Loaded loaded (/lib/systemd/system/rc-local service; static; vendor preset enabled)
: : 2015 11 26 23:54:58 59
Active failed (Result exit-code) since Thu - - CST; s ago
47. : 1001 . , 1
Process ExecStart=/etc/rc local start (code=exited status= /FAILURE)
26 23:54:57 . 1001 : 2.7 . ,
Nov vivid rc local[ ] File "/usr/lib/python /dist-packages/pkg_resources/__init__ py" line
920, in require
26 23:54:57 . 1001 : .
Nov vivid rc local[ ] needed = self resolve(parse_requirements(requirements))
26 23:54:57 . 1001 : 2.7 . ,
Nov vivid rc local[ ] File "/usr/lib/python /dist-packages/pkg_resources/__init__ py" line
807, in resolve
26 23:54:57 . 1001 :
Nov vivid rc local[ ] raise DistributionNotFound(req)
26 23:54:57 . 1001 : . : 2.8.2
Nov vivid rc local[ ] pkg_resources DistributionNotFound shadowsocks==
26 23:54:58 1008 : : :
Nov vivid sudo[ ] pam_unix(sudo session) session closed for user root
26 23:54:58 1 : . : , 1
Nov vivid systemd[ ] rc-local service control process exited code=exited status=
26 23:54:58 1 : . .
Nov vivid systemd[ ] Failed to start /etc/rc local Compatibility
26 23:54:58 1 : . .
Nov vivid systemd[ ] Unit rc-local service entered failed state
26 23:54:58 1 : . .
Nov vivid systemd[ ] rc-local service failed