Hogyan lehetséges, hogy a "systemctl start apache" paranccsal el tudom indítani az apache webszerveremet, de a "systemctl --type=service" listában mégsem szerepel az apache?
- 259 megtekintés
Hozzászólások
systemctl --type=service |grep httpd
httpd.service loaded active running The Apache HTTP Server
Milyen rendszer ez?
- A hozzászóláshoz be kell jelentkezni
Debian 10. A systemctl --type=service --state=running kimenete:
UNIT LOAD ACTIVE SUB DESCRIPTION
cron.service loaded active running Regular background program processing daemon
dbus.service loaded active running D-Bus System Message Bus
exim4.service loaded active running LSB: exim Mail Transport Agent
getty@tty1.service loaded active running Getty on tty1
icinga.service loaded active running LSB: icinga host/service/network monitoring and management system
mariadb.service loaded active running MariaDB 10.1.47 database server
pdns.service loaded active running PowerDNS Authoritative Server
rpcbind.service loaded active running RPC bind portmap service
rsyslog.service loaded active running System Logging Service
ssh.service loaded active running OpenBSD Secure Shell server
systemd-journald.service loaded active running Journal Service
systemd-timesyncd.service loaded active running Network Time Synchronization
systemd-udevd.service loaded active running udev Kernel Device Manager
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
13 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
Pedig a webszerver fut közben, rendben szolgálja ki a kérelmeket.
- A hozzászóláshoz be kell jelentkezni
systemctl --type=service --state=running |grep httpd
httpd.service loaded active running The Apache HTTP Server
Fura, tenyleg, mert lathatoan nalam ott van, ahogy kell. Mondjuk ez CentOS, meg eleve csak RH-fele rendszereket hasznalok.
A systemd szerint is rendesen fut (systemctl status..)?
- A hozzászóláshoz be kell jelentkezni
Eressz már rá egy --all-t is, aztán egy systemctl edit httpd.service -t (vagy apache.service-t).
BlackY
"Gyakran hasznos ugyanis, ha számlálni tudjuk, hányszor futott le már egy végtelenciklus." (haroldking)
- A hozzászóláshoz be kell jelentkezni
Érdekes. A "systemctl status apache2" kimenete:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2020-11-13 08:54:00 CET; 1h 43min ago
Process: 23930 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
Process: 23925 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
De a "systemctl --all | grep apache" kimenete:
apache2.service loaded inactive dead The Apache HTTP Server
Közben persze a webszerver rendben fut.
- A hozzászóláshoz be kell jelentkezni
Na, alakul ez..mit ertunk az alatt, hogy a "webszerver rendben fut"? Netstat pl. mit mond (vagy a ps)?
- A hozzászóláshoz be kell jelentkezni
Kiadtam a "systemctl restart apache2" parancsot.
Erre leállt a webszerver
Újra kiadtam ugyanezt, most már újra fut a webszerver, de már a status is azt mutatja, hogy fut, és bekerült a running listába is.
Megnéztem az apache error.log-ját, de semmi, az újraindítások megszokott üzenetein kívül.
?
- A hozzászóláshoz be kell jelentkezni
cat /lib/systemd/system/apache2.service
...
Type=forking
...
apache hatterbe megy, de a systemd figyeli a pid alajnan. egyszer egy restartkor leallitotta, a main process le is allt, de az egyik worker process nem hallgatott ra es szepen elmaszott tole.
A vegtelen ciklus is vegeter egyszer, csak kelloen eros hardver kell hozza!
- A hozzászóláshoz be kell jelentkezni
Ez érdekes! ... Köszi.
- A hozzászóláshoz be kell jelentkezni
Az előfordulhat, hogy valami rc-ből indul a systemd-t kikerülve?
Melyik linuxot használod?
- A hozzászóláshoz be kell jelentkezni
Debian 10-et hasznal, ezt en is kerdeztem.
- A hozzászóláshoz be kell jelentkezni
Ja, hogy közben alakult is a dolog. Meg kellene tanulnom olvasni..
- A hozzászóláshoz be kell jelentkezni
Units can be aliased (have an alternative name), by creating a symlink from the new name to the existing name in one of the unit search paths. For example,
systemd-networkd.service
has the aliasdbus-org.freedesktop.network1.service
, created during installation as a symlink, so when systemd is asked through D-Bus to loaddbus-org.freedesktop.network1.service
, it'll loadsystemd-networkd.service
. As another example,default.target
— the default system target started at boot — is commonly symlinked (aliased) to eithermulti-user.target
orgraphical.target
to select what is started by default. Alias names may be used in commands like disable, start, stop, status, and similar, and in all unit dependency directives, includingWants=
,Requires=
,Before=
,After=
. Aliases cannot be used with the preset command.
BlackY
"Gyakran hasznos ugyanis, ha számlálni tudjuk, hányszor futott le már egy végtelenciklus." (haroldking)
- A hozzászóláshoz be kell jelentkezni
Így már én is jártam!
Készítettem egy rendszert, ahol kötelező volt az apache. A dokumentációban azt is le kellett írni, hogy melyk program melyiket indítja. Egyszer csak felhív a megrendelést bonyolító leányzó:
- Kerestük a kollégámmal ezt a httpd-t de nem találtuk. Végülis nem fontos, használhatod ezt is az apache helyett.
Küldtem nekik egy linket: https://httpd.apache.org/docs/trunk/invoking.html
Ők is informatikusok voltak.
(Define informatikus: Aki mindenhez semmit sem ért.)
- A hozzászóláshoz be kell jelentkezni
Nem, nem az a problémám, hogy httpd van apache helyett. Nincs webszerver a szolgáltatások között, holott van.
- A hozzászóláshoz be kell jelentkezni
Na és a 80-as porton (már ha úgy van konfigurálva) milyen daemon ül?
pl.:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 810/apache2
netstat mit mond?
- A hozzászóláshoz be kell jelentkezni
Egy background programot sokféle módon lehet elindítani. Ebből csak az egyik kategória a "service".
- A hozzászóláshoz be kell jelentkezni
Define informatikus: Aki alkalmas arra, hogy önállóan tanuljon majd problémákat oldjon meg.
- A hozzászóláshoz be kell jelentkezni
sub.
- A hozzászóláshoz be kell jelentkezni
Van a service file-ban alias field. Valószínűleg ezért.
- A hozzászóláshoz be kell jelentkezni