You are not logged in.

#26 2016-10-27 22:06:52

shsina
Member
Registered: 2016-10-22
Posts: 47

Re: [SOLVED] Name or service not known

V1del wrote:

Yeah that's normal, NetworkManager-wait-online target is only supposed to trigger execution of the network-online.target . What is your httpd.service pointing to now? It should have an After=network-online.target now (maybe WantedBy=network-online.target and Wantss=network-online.target as well) and remove the references to NetworkManager there. Don't hang yourself up on that DAEMONS line, that's for pre-systemd configuration.

This is default httpd.service which is active now:

[Unit]
Description=Apache Web Server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
ExecStart=/usr/bin/httpd -k start -DFOREGROUND
ExecStop=/usr/bin/httpd -k graceful-stop
ExecReload=/usr/bin/httpd -k graceful
PrivateTmp=true
LimitNOFILE=infinity
KillMode=mixed

[Install]
WantedBy=multi-user.target

I have changed "After" value to "network-online.target remote-fs.target nss-lookup.target", but NetworkManager-wait-online doesn't start on booting at all...

Last edited by shsina (2016-10-27 22:13:31)

Offline

#27 2016-10-28 11:21:51

shsina
Member
Registered: 2016-10-22
Posts: 47

Re: [SOLVED] Name or service not known

V1del wrote:

Yeah that's normal, NetworkManager-wait-online target is only supposed to trigger execution of the network-online.target . What is your httpd.service pointing to now? It should have an After=network-online.target now (maybe WantedBy=network-online.target and Wantss=network-online.target as well) and remove the references to NetworkManager there. Don't hang yourself up on that DAEMONS line, that's for pre-systemd configuration.

Congratulation to me, Congratulation to you, Congratulation to us, hahaha big_smile

I have fixed this problem I should just add "Wants=network-online.target" to httpd.service file...

"Wants" in "Unit" section means:

A weaker version of Requires=. Units listed in this option will be
           started if the configuring unit is. However, if the listed units
           fail to start or cannot be added to the transaction, this has no
           impact on the validity of the transaction as a whole. This is the
           recommended way to hook start-up of one unit to the start-up of
           another unit.

           Note that dependencies of this type may also be configured outside
           of the unit configuration file by adding symlinks to a .wants/
           directory accompanying the unit file. For details, see above.

"Before" and "After" in "Unit" section means:

A space-separated list of unit names. Configures ordering
           dependencies between units. If a unit foo.service contains a
           setting Before=bar.service and both units are being started,
           bar.service's start-up is delayed until foo.service is started up.
           Note that this setting is independent of and orthogonal to the
           requirement dependencies as configured by Requires=. It is a common
           pattern to include a unit name in both the After= and Requires=
           option, in which case the unit listed will be started before the
           unit that is configured with these options. This option may be
           specified more than once, in which case ordering dependencies for
           all listed names are created.  After= is the inverse of Before=,
           i.e. while After= ensures that the configured unit is started after
           the listed unit finished starting up, Before= ensures the opposite,
           i.e. that the configured unit is fully started up before the listed
           unit is started. Note that when two units with an ordering
           dependency between them are shut down, the inverse of the start-up
           order is applied. i.e. if a unit is configured with After= on
           another unit, the former is stopped before the latter if both are
           shut down. Given two units with any ordering dependency between
           them, if one unit is shut down and the other is started up, the
           shutdown is ordered before the start-up. It doesn't matter if the
           ordering dependency is After= or Before=. It also doesn't matter
           which of the two is shut down, as long as one is shut down and the
           other is started up. The shutdown is ordered before the start-up in
           all cases. If two units have no ordering dependencies between them,
           they are shut down or started up simultaneously, and no ordering
           takes place.

My new httpd.service file:

[Unit]
Description=Apache Web Server
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/httpd -k start -DFOREGROUND
ExecStop=/usr/bin/httpd -k graceful-stop
ExecReload=/usr/bin/httpd -k graceful
PrivateTmp=true
LimitNOFILE=infinity
KillMode=mixed

[Install]
WantedBy=multi-user.target

for more information:

$ man systemd.unit

and:

http://unix.stackexchange.com/questions … as-started

Last edited by shsina (2016-10-28 11:37:12)

Offline

#28 2016-10-28 11:36:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,866

Re: [SOLVED] Name or service not known

Sweet, but something is still off, Apache shouldn't require the network to be online and should be able to react on it becoming available on its own... However if the problem is solved don't forget to edit your initial post and prepend [SOLVED] to the title.

Offline

#29 2016-10-28 11:38:59

shsina
Member
Registered: 2016-10-22
Posts: 47

Re: [SOLVED] Name or service not known

V1del wrote:

Sweet, but something is still off, Apache shouldn't require the network to be online and should be able to react on it becoming available on its own... However if the problem is solved don't forget to edit your initial post and prepend [SOLVED] to the title.

Yes, my problem solved, You are right It seems there is a bug some where... It can be better if we report the bug.

Offline

Board footer

Powered by FluxBB