My OS is Ubuntu 18.04.02 - There is no NTP, I had to install it using apt-get. I have an application which I must use NTP for compatibility. I disabled and removed timesyncd to avoid conflicts.
I configured ntp.conf to use:
0.north-america.pool.ntp.org
1.north-america.pool.ntp.org
2.north-america.pool.ntp.org
I can ping them without issues. The internet connection is fine. NTP service is running but is in the soliciting state forever and it is not synchronizing the time.
This is just a client IoT device. I just need to synchronize the time to execute our tasks in sync with the other computers on the same network.
What am I missing ? Do I have to enable firewall or ports? I am blocking IPV6, I added -4 to NTPD_OPTS.
$ sudo service ntp status
● ntp.service - Network Time Service
Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enab
Active: active (running) since Mon 2020-03-02 13:07:14 EST; 17h ago
Docs: man:ntpd(8)
Process: 2078 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status=
Main PID: 2090 (ntpd)
Tasks: 2 (limit: 1600)
CGroup: /system.slice/ntp.service
└─2090 /usr/sbin/ntpd -p /var/run/ntpd.pid -4 -g -u 106:113
Mar 03 06:36:13 FD50-AE ntpd[2090]: Soliciting pool server 209.115.181.1
Mar 03 06:36:34 FD50-AE ntpd[2090]: Soliciting pool server 45.33.2.219
Mar 03 06:36:38 FD50-AE ntpd[2090]: Soliciting pool server 64.79.100.197
Mar 03 06:36:55 FD50-AE ntpd[2090]: Soliciting pool server 91.189.91.157
Mar 03 06:37:20 FD50-AE ntpd[2090]: Soliciting pool server 149.56.47.60
Mar 03 06:37:20 FD50-AE ntpd[2090]: bind(19) AF_INET 127.0.0.1#123 flags
Mar 03 06:37:20 FD50-AE ntpd[2090]: unable to create socket on lo (212)
Mar 03 06:37:20 FD50-AE ntpd[2090]: failed to init interface for address
Mar 03 06:37:38 FD50-AE ntpd[2090]: Soliciting pool server 45.63.54.13
Mar 03 06:37:43 FD50-AE ntpd[2090]: Soliciting pool server 173.255.140.3
[1]+ Stopped sudo service ntp status
$ ntpstat
unsynchronised
polling server every 8 s
$ timedatectl
Local time: Tue 2020-03-03 06:58:34 EST
Universal time: Tue 2020-03-03 11:58:34 UTC
RTC time: Tue 2020-03-03 11:58:34
Time zone: America/New_York (EST, -0500)
System clock synchronized: no
systemd-timesyncd.service active: no
RTC in local TZ: no
$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
0.north-america .POOL. 16 p - 64 0 0.000 0.000 0.000
1.north-america .POOL. 16 p - 64 0 0.000 0.000 0.000
2.north-america .POOL. 16 p - 64 0 0.000 0.000 0.000
ntp.ubuntu.com .POOL. 16 p - 64 0 0.000 0.000 0.000
$
$ sudo systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd-timesyncd.service(8)
my ntp.conf below:
#interface listen IPv4
#interface ignore IPv6
interface ignore wildcard
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Leap seconds definition provided by tzdata
leapfile /usr/share/zoneinfo/leap-seconds.list
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# Specify one or more NTP servers.
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
pool 0.north-america.pool.ntp.org iburst
pool 1.north-america.pool.ntp.org iburst
pool 2.north-america.pool.ntp.org iburst
# Use Ubuntu's ntp server as a fallback.
pool ntp.ubuntu.com
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Needed for adding pool entries
restrict source notrap nomodify noquery
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
#Changes recquired to use pps synchonisation as explained in documentation:
#http://www.ntp.org/ntpfaq/NTP-s-config-adv.htm#AEN3918
#server 127.127.8.1 mode 135 prefer # Meinberg GPS167 with PPS
#fudge 127.127.8.1 time1 0.0042 # relative to PPS for my hardware
#server 127.127.22.1 # ATOM(PPS)
#fudge 127.127.22.1 flag3 1 # enable PPS API
I had some problems setting up my Ubuntu 18.04 machine before. I just looked at the some logs and I might be able to help.
$ timedatectl
Local time: Wed 2020-03-18 18:01:20 GMT
Universal time: Wed 2020-03-18 18:01:20 UTC
RTC time: Wed 2020-03-18 18:01:20
Time zone: Europe/London (GMT, +0000)
System clock synchronized: yes
This is the my timedatectl output. I got to syncronize it by adding this to "/etc/systemd/timesyncd.conf" :
[Time]
NTP=10.199.999.99 10.999.999.999
Just put the ip addresses of the servers you are trying to synchronize with. The restart timedate and ntp and systemd timesync service. (or reboot :) ). And you should be fine, I don't remember doing anything else. Hope this helps.
Related
enter image description here
I am trying to install netboxtool but when i try to start postgesql it giving me below errors.Selinux already disabled.
[1][root#it ~]# systemctl start postgresql-13 Job for postgresql-13.service failed because the control process exited with error code. See "systemctl status postgresql-13.service" and "journalctl -xe" for details. [root#it ~]# journalctl -xe -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit session-6.scope has finished starting up.
-- The start-up result is done. Apr 09 19:32:45 it sshd[2686]: pam_unix(sshd:session): session opened for user root by (uid=0) Apr 09 19:32:45 it systemd-logind[641]: New session 6 of user root. -- Subject: A new session 6 has been created for user root -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
-- A new session with the ID 6 has been created for the user root.
-- The leading process of the session is 2686. Apr 09 19:32:50 it polkitd[1383]: Registered Authentication Agent for unix-process:2714:612049 (system bus name :1.38 [/usr/bin/pkttyagent --notify-fd 5 --fallbac Apr 09 19:32:50 it systemd1: Starting PostgreSQL 13 database server... -- Subject: Unit postgresql-13.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit postgresql-13.service has begun starting up. Apr 09 19:32:50 it postgresql-13-check-db-dir[2720]: "/var/lib/pgsql/13/data/" is missing or empty. Apr 09 19:32:50 it postgresql-13-check-db-dir[2720]: Use "/usr/pgsql-13/bin/postgresql-13-setup initdb" to initialize the database cluster. Apr 09 19:32:50 it postgresql-13-check-db-dir[2720]: See /usr/share/doc/postgresql13-13.6/README.rpm-dist for more information. Apr 09 19:32:50 it systemd1: postgresql-13.service: control process exited, code=exited status=1 Apr 09 19:32:50 it systemd1: Failed to start PostgreSQL 13 database server. -- Subject: Unit postgresql-13.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit postgresql-13.service has failed.
-- The result is failed. Apr 09 19:32:50 it systemd1: Unit postgresql-13.service entered failed state. Apr 09 19:32:50 it systemd1: postgresql-13.service failed. Apr 09 19:32:50 it polkitd[1383]: Unregistered Authentication Agent for unix-process:2714:612049 (system bus name :1.38, object path /org/freedesktop/PolicyKit1/A lines 2130-2166/2166 (END)
The error states that the default data directory /var/lib/pgsql/13/data is missing. Check if that exists and create it.
I have a problem with connection to PostgreSQL.
I mounted the Docker image throught the docker-compose.yml below:
version: '2'
volumes:
mongodb_repl_data11:
external: true
mongodb_repl_data12:
external: true
mongodb_repl_data13:
external: true
datapostgres:
datapgadmin:
activemqdata:
services:
mongo0:
hostname: mongo0
container_name: mongo0
image: mongo:4.0
expose:
- 30000
ports:
- 30000:30000
volumes:
- 'mongodb_repl_data11:/data/db:z'
restart: always
command: "--bind_ip_all --replSet rs0 --port 30000"
mongo1:
hostname: mongo1
container_name: mongo1
image: mongo:4.0
expose:
- 30001
ports:
- 30001:30001
volumes:
- 'mongodb_repl_data12:/data/db:z'
restart: always
command: "--bind_ip_all --replSet rs0 --port 30001"
mongo2:
hostname: mongo2
container_name: mongo2
image: mongo:4.0
expose:
- 30002
ports:
- 30002:30002
volumes:
- 'mongodb_repl_data13:/data/db:z'
restart: always
command: "--bind_ip_all --replSet rs0 --port 30002"
postgres:
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
PGDATA: /data/postgres
volumes:
- datapostgres:/data/postgres
ports:
- "5432:5432"
pgadmin:
links:
- postgres:postgres
image: fenglc/pgadmin4
volumes:
- datapgadmin:/root/.pgadmin
ports:
- "5050:5050"
activemq:
image: rmohr/activemq:5.15.6
ports:
- "8161:8161"
- "61616:61616"
volumes:
- activemqdata:/opt/activemq/data
environment:
- ACTIVEMQ_CONFIG_SCHEDULERENABLED=true
but when i try to connect throught DBeaver 21.0.5 (username: postgres , password: postgres) it says: FATAL: password authentication failed for user "postgres"
before test connection
drivers
I have already tried to enter the Postgres Docker instance and change the password with ALTER USER postgres PASSWORD 'newPassword';
---------------- UPDATE -----------
I found out from the Docker logs that the server shuts down immediately after boot.
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
2021-11-23 10:54:35.410 UTC [1] LOG: starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-11-23 10:54:35.410 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-11-23 10:54:35.410 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-11-23 10:54:35.438 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-11-23 10:54:35.464 UTC [61] LOG: database system was shut down at 2021-11-23 10:54:35 UTC
2021-11-23 10:54:35.483 UTC [1] LOG: database system is ready to accept connections
2021-11-23 11:18:15.203 UTC [99] FATAL: role "root" does not exist
2021-11-23 11:32:38.850 UTC [1] LOG: received smart shutdown request
2021-11-23 11:32:38.887 UTC [1] LOG: background worker "logical replication launcher" (PID 67) exited with exit code 1
2021-11-23 11:32:38.888 UTC [62] LOG: shutting down
2021-11-23 11:32:38.943 UTC [1] LOG: database system is shut down
2021-11-23 11:36:05.235 UTC [1] LOG: starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-11-23 11:36:05.236 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-11-23 11:36:05.236 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-11-23 11:36:05.253 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-11-23 11:36:05.272 UTC [26] LOG: database system was shut down at 2021-11-23 11:32:38 UTC
2021-11-23 11:36:05.287 UTC [1] LOG: database system is ready to accept connections
2021-11-23 14:38:48.475 UTC [75] FATAL: terminating connection due to administrator command
2021-11-23 14:38:48.721 UTC [1] LOG: received smart shutdown request
2021-11-23 14:38:48.782 UTC [1] LOG: background worker "logical replication launcher" (PID 32) exited with exit code 1
2021-11-23 14:38:48.782 UTC [27] LOG: shutting down
2021-11-24 13:30:19.017 UTC [1] LOG: starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-11-24 13:30:19.018 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-11-24 13:30:19.018 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-11-24 13:30:19.044 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-11-24 13:30:19.066 UTC [27] LOG: database system was shut down at 2021-11-23 14:38:48 UTC
2021-11-24 13:30:19.098 UTC [1] LOG: database system is ready to accept connections
2021-11-24 13:32:42.060 UTC [1] LOG: received fast shutdown request
2021-11-24 13:32:42.078 UTC [1] LOG: aborting any active transactions
2021-11-24 13:32:42.081 UTC [1] LOG: background worker "logical replication launcher" (PID 33) exited with exit code 1
2021-11-24 13:32:42.082 UTC [28] LOG: shutting down
2021-11-24 13:32:42.157 UTC [1] LOG: database system is shut down
2021-11-24 13:32:44.238 UTC [1] LOG: starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-11-24 13:32:44.244 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-11-24 13:32:44.244 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-11-24 13:32:44.278 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-11-24 13:32:44.309 UTC [27] LOG: database system was shut down at 2021-11-24 13:32:42 UTC
2021-11-24 13:32:44.324 UTC [1] LOG: database system is ready to accept connections
2021-11-24 13:47:09.297 UTC [1] LOG: received fast shutdown request
2021-11-24 13:47:09.307 UTC [1] LOG: aborting any active transactions
2021-11-24 13:47:09.310 UTC [1] LOG: background worker "logical replication launcher" (PID 33) exited with exit code 1
2021-11-24 13:47:09.311 UTC [28] LOG: shutting down
2021-11-24 13:47:09.363 UTC [1] LOG: database system is shut down
2021-11-24 13:47:11.392 UTC [1] LOG: starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-11-24 13:47:11.392 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-11-24 13:47:11.392 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-11-24 13:47:11.435 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-11-24 13:47:11.467 UTC [26] LOG: database system was shut down at 2021-11-24 13:47:09 UTC
2021-11-24 13:47:11.482 UTC [1] LOG: database system is ready to accept connections
2021-11-24 13:52:10.719 UTC [1] LOG: starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-11-24 13:52:10.719 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-11-24 13:52:10.719 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-11-24 13:52:10.808 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-11-24 13:52:10.847 UTC [27] LOG: database system was interrupted; last known up at 2021-11-24 13:47:11 UTC
2021-11-24 13:52:12.059 UTC [27] LOG: database system was not properly shut down; automatic recovery in progress
2021-11-24 13:52:12.079 UTC [27] LOG: redo starts at 0/16FD130
2021-11-24 13:52:12.079 UTC [27] LOG: invalid record length at 0/16FD168: wanted 24, got 0
2021-11-24 13:52:12.079 UTC [27] LOG: redo done at 0/16FD130 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2021-11-24 13:52:12.182 UTC [1] LOG: database system is ready to accept connections
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /data/postgres ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Success. You can now start the database server using:
pg_ctl -D /data/postgres -l logfile start
waiting for server to start....2021-11-23 10:54:34.889 UTC [49] LOG: starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-11-23 10:54:34.907 UTC [49] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-11-23 10:54:34.943 UTC [50] LOG: database system was shut down at 2021-11-23 10:54:33 UTC
2021-11-23 10:54:34.961 UTC [49] LOG: database system is ready to accept connections
done
server started
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2021-11-23 10:54:35.124 UTC [49] LOG: received fast shutdown request
waiting for server to shut down....2021-11-23 10:54:35.139 UTC [49] LOG: aborting any active transactions
2021-11-23 10:54:35.146 UTC [49] LOG: background worker "logical replication launcher" (PID 56) exited with exit code 1
2021-11-23 10:54:35.157 UTC [51] LOG: shutting down
2021-11-23 10:54:35.244 UTC [49] LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
PostgreSQL Database directory appears to contain a database; Skipping initialization
I just started learning mongodb everything was going well until I tried stoping the server using sudo systemctl stop mongod and restarting it usingsudo systemctl start mongod.
now its showing:-
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-01-16 12:39:04 IST; 3s ago
Docs: https://docs.mongodb.org/manual
Process: 357998 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAILURE)
Main PID: 357998 (code=exited, status=1/FAILURE)
Jan 16 12:39:04 prabal-computer systemd[1]: Started MongoDB Database Server.
Jan 16 12:39:04 prabal-computer mongod[357998]: {"t":{"$date":"2021-01-16T07:09:04.669Z"},"s":"F", "c":"CONTROL", "id":20574, "ctx":"main">
Jan 16 12:39:04 prabal-computer systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 12:39:04 prabal-computer systemd[1]: mongod.service: Failed with result 'exit-code'.
lines 1-11/11 (END)
whenever I am trying to start and see the status using sudo systemctl status mongod,this error appears.
note: I have already tried reinstalling the mongodb
Every time i checked the MSSQL service is failing i have over 5 GB memory on my virtual server. I have changed the sql port to 1533.
r*****k:~# sudo systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Fri 2017-11-17 15:39:39 UTC; 1min 37s ago
Process: 4906 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=255)
Main PID: 4906 (code=exited, status=255)
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Unit entered failed state.
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.
Nov 17 15:39:39 SV0*****.com systemd[1]: Stopped Microsoft SQL Server Database Engine.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Start request repeated too quickly.
Nov 17 15:39:39 SV0*****.com systemd[1]: Failed to start Microsoft SQL Server Database Engine.
r*****k:/var/opt/mssql# cat mssql.conf
> [EULA] accepteula = Y</br>
>
> [network] ipaddress = 6*.*1.1*2.*8 kerberoskeytabfile =
> /var/opt/mssql/secrets/mssql.keytab tcpport = 1533
>
> [memory] memorylimitmb = 3328
>
> [filelocation] defaultdatadir = /tmp/data
Anyone can help to stable the mssql service on the vm.
Does your Ubuntu server have the firewall enabled? If so, it may be blocking port 1533, which is preventing the service from starting on that custom port.
You may want to look in /var/log/messages for additional information as well.
I updated Apache2 on my Rapsberry Pi (using: apt install apache2 --only-upgrade) and now it is not starting:
root#pi:/etc/apache2 # service apache2 start
Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
root#pi:/etc/apache2 # systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled)
Active: failed (Result: resources) since Sun 2017-02-05 16:19:48 CET; 28min ago
Feb 05 16:47:44 pi systemd[1]: Starting The Apache HTTP Server...
Feb 05 16:47:44 pi systemd[1]: apache2.service failed to run 'start' task: No such file or directory
Feb 05 16:47:44 pi systemd[1]: Failed to start The Apache HTTP Server.
Version of apache2:
Server version: Apache/2.4.25 (Raspbian)
Server built: 2017-01-25T22:59:26
apache2ctl -t shows:
Syntax OK
I tried disabling all virtual hosts (only default left) but it didn't change anything.
Output of just apache2:
[Mon Feb 06 01:25:09.079790 2017] [core:warn] [pid 2954] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
I had the same issue after upgrading a Dockerfile from 14.04 to 17.04.
The solution for me was to manually add the apache directory in /var/run
So the fix was:
mkdir /var/run/apache2
The DefaultRuntimeDir was set to /var/run/apache2 but the folder was missing.