[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: wtf just happened to my local staging web server



On Thu, May 05, 2022 at 08:37:04AM +0200, Erwan David wrote:
> > root@TheLibrarian:~# service apache2 start
> 
> It looks like you started it, not restart, thus the running apache is not
> killed
> 
> [...]
> 
> > 
> > May 04 12:16:55 TheLibrarian systemd[1]: Starting The Apache HTTP Server...
> > May 04 12:16:55 TheLibrarian apachectl[7935]: (98)Address already in
> > use: AH00072: make_sock: could not bind to addre>
> > May 04 12:16:55 TheLibrarian apachectl[7935]: (98)Address already in
> > use: AH00072: make_sock: could not bind to addre>
> 
> This is consistent with former apache still running at that time, and using
> the wanted ports.

Except that systemd is more clever than that.  If a service is already
running, and you issue a "start" for it, it'll do nothing.

unicorn:~$ systemctl status mariadb
● mariadb.service - MariaDB 10.5.15 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor prese>
     Active: active (running) since Tue 2022-05-03 07:16:46 EDT; 1 day 23h ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 683 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/>
    Process: 691 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_STA>
    Process: 694 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && V>
    Process: 769 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_ST>
    Process: 771 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/S>
   Main PID: 749 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 8 (limit: 14199)
     Memory: 118.7M
        CPU: 26.273s
     CGroup: /system.slice/mariadb.service
             └─749 /usr/sbin/mariadbd

Warning: some journal files were not opened due to insufficient permissions.
unicorn:~$ sudo systemctl start mariadb
[sudo] password for greg: 
unicorn:~$ systemctl status mariadb
● mariadb.service - MariaDB 10.5.15 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor prese>
     Active: active (running) since Tue 2022-05-03 07:16:46 EDT; 1 day 23h ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 683 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/>
    Process: 691 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_STA>
    Process: 694 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && V>
    Process: 769 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_ST>
    Process: 771 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/S>
   Main PID: 749 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 8 (limit: 14199)
     Memory: 118.7M
        CPU: 26.283s
     CGroup: /system.slice/mariadb.service
             └─749 /usr/sbin/mariadbd

Warning: some journal files were not opened due to insufficient permissions.
unicorn:~$ sudo journalctl -u mariadb | tail -n5
May 03 07:16:46 unicorn mariadbd[749]: 2022-05-03  7:16:46 0 [Note] Added new Master_info '' to hash table
May 03 07:16:46 unicorn mariadbd[749]: 2022-05-03  7:16:46 0 [Note] /usr/sbin/mariadbd: ready for connections.
May 03 07:16:46 unicorn mariadbd[749]: Version: '10.5.15-MariaDB-0+deb11u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 11
May 03 07:16:46 unicorn systemd[1]: Started MariaDB 10.5.15 database server.
May 03 07:16:47 unicorn mariadbd[749]: 2022-05-03  7:16:47 0 [Note] InnoDB: Buffer pool(s) load completed at 220503  7:16:47


Note that this "Started MariaDB ..." happened 2 days ago, consistent with
the "1 day 23h ago" from systemctl status.  The start command that I issued
had no effect at all.  It didn't even add a line to the journal.


Reply to: