Solved Missing rc.d file in mariadb install

Figured I'd ask here since I'm not finding any solution on the net other than re-install which I prefer not to do.
I have a couple of freebsd 13 servers running with freshly installed mariadb 10.5.

I have
sysrc mysql_enable="YES"
in the /etc/rc.conf.

I ran the safe installation and got everything going. However, trying to control the service leads to nothing having been installed in the rc.d folder.
Oddly, it was running but after a reboot, nothing.

# sockstat -4 -6 | grep mysql
nothing running.

The result showed it was running when it was before this problem.

# service mariadb status (and variations)
mariadb does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable

# service mariadb-server status
mariadb-server does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable

# ls -la /usr/local/etc/rc.d
-rwxr-xr-x 1 root wheel 6132 Apr 11 22:14 apache24
-rwxr-xr-x 1 root wheel 3070 Apr 7 20:55 garb
-rwxr-xr-x 1 root wheel 1732 Apr 11 22:14 htcacheclean
-rwxr-xr-x 1 root wheel 1212 Apr 15 18:15 php-fpm
-rwxr-xr-x 1 root wheel 986 Apr 7 02:52 rsyncd

All of the db files are still in the /var/db structure.
What's happened and what's the quickest fix so I can get back to work?
Maybe all I need is the file that does into the rc.d? Maybe someone can share theirs?

See, I swear it was running! :).

Code:
2022-05-11 10:20:50 0 [Note] InnoDB: Uses event mutexes
2022-05-11 10:20:50 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-05-11 10:20:50 0 [Note] InnoDB: Number of pools: 1
2022-05-11 10:20:50 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-05-11 10:20:50 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-05-11 10:20:50 0 [Note] InnoDB: Completed initialization of buffer pool
2022-05-11 10:20:50 0 [Note] InnoDB: 128 rollback segments are active.
2022-05-11 10:20:50 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-05-11 10:20:50 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-05-11 10:20:50 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-05-11 10:20:50 0 [Note] InnoDB: 10.5.15 started; log sequence number 60409; transaction id 44
2022-05-11 10:20:50 0 [Note] InnoDB: Loading buffer pool(s) from /var/db/mysql/ib_buffer_pool
2022-05-11 10:20:50 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-05-11 10:20:50 0 [Note] InnoDB: Buffer pool(s) load completed at 220511 10:20:50
2022-05-11 10:20:50 0 [Note] Server socket created on IP: '::'.
2022-05-11 10:20:50 0 [Note] Reading of all Master_info entries succeeded
2022-05-11 10:20:50 0 [Note] Added new Master_info '' to hash table
2022-05-11 10:20:50 0 [Note] /usr/local/libexec/mariadbd: ready for connections.
Version: '10.5.15-MariaDB'  socket: '/var/run/mysql/mysql.sock'  port: 3306  FreeBSD Ports
2022-05-11 11:45:26 0 [Note] /usr/local/libexec/mariadbd (initiated by: unknown): Normal shutdown
2022-05-11 11:45:26 0 [Note] Event Scheduler: Purging the queue. 0 events
2022-05-11 11:45:26 0 [Note] InnoDB: FTS optimize thread exiting.
2022-05-11 11:45:26 0 [Note] InnoDB: Starting shutdown...
2022-05-11 11:45:26 0 [Note] InnoDB: Dumping buffer pool(s) to /var/db/mysql/ib_buffer_pool
2022-05-11 11:45:26 0 [Note] InnoDB: Buffer pool(s) dump completed at 220511 11:45:26
2022-05-11 11:45:26 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2022-05-11 11:45:26 0 [Note] InnoDB: Shutdown completed; log sequence number 61565; transaction id 49
2022-05-11 11:45:26 0 [Note] /usr/local/libexec/mariadbd: Shutdown complete
 
I have
sysrc mysql_enable="YES"
in the /etc/rc.conf.
You have sysrc mysql_enable="YES" literally in rc.conf? That's not correct. You're supposed to execute sysrc mysql_enable="YES" on the command line. That will set mysql_enable="YES" in /etc/rc.conf.

# service mariadb status (and variations)
mariadb does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
It's service mysql-server status. MariaDB was originally intended as a drop-in replacement for MySQL. So it inherited the MySQL rc(8) script.
 
Install latest version of mariadb server and client:

# pkg install mariadb106-server mariadb106-client

and run these commands in terminal to start and install mariadb :
Code:
# sysrc mysql_enable=yes
# service mysql-server start
# mysql_secure_installation
 
Oddly, this is what I did.
I needed to copy the service file. This wasn't mentioned in the article I followed and I didn't notice it while installing the service.
However, this time, there was already the correct file in there so something must have deleted it or a step in the article I followed.

# cp /usr/local/share/mysql/mysql.server /usr/local/etc/rc.d/
# ls -la /usr/local/etc/rc.d/
-rwxr-xr-x 1 root wheel 4230 Apr 13 07:35 mysql-server
-rwxr-xr-x 1 root wheel 12332 May 11 22:16 mysql.server
-rwxr-xr-x 1 root wheel 986 Apr 7 10:52 rsyncd

# service mysql-server status
mysql is running as pid 98228.

# cd /usr/local/etc/rc.d/
# ls -la
-rwxr-xr-x 1 root wheel 4230 Apr 13 07:35 mysql-server
-rwxr-xr-x 1 root wheel 12332 May 11 22:16 mysql.server
-rwxr-xr-x 1 root wheel 986 Apr 7 10:52 rsyncd

# mv mysql.server /
# service mysql-server status
mysql is running as pid 98228.

# service mysql-server stop
Stopping mysql.
Waiting for PIDS: 98228.
# service mysql-server start
Starting mysql.
 
>You have sysrc mysql_enable="YES" literally in rc.conf?

No, I just failed to remove that when posting.
mysql_enable="YES"

>Install latest version of mariadb server and client:

Maybe you didn't fully read my post :).

Yes, I already installed it, it was running but somehow, the service file got removed.
Anyhow, that's solved and it seemed to startnow, thanks.
 
Reinstalling mariadb10[56]-server would have recreated that missing rc(8) file (it's part of the port/package). And no, this won't destroy your databases or your settings. Just make sure you're reinstalling the same version you already had.

For example:
Code:
root@lady3jane:~ # pkg info -x mariadb
mariadb105-client-10.5.15_3
mariadb105-server-10.5.15_3
root@lady3jane:~ # pkg install -f mariadb105-server
Updating dicelan repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
Fetching packagesite.pkg: 100%  278 KiB 284.5kB/s    00:01
Processing entries: 100%
dicelan repository update completed. 1194 packages processed.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        mariadb105-server-10.5.15_3

Number of packages to be reinstalled: 1

28 MiB to be downloaded.

Proceed with this action? [y/N]: n
 
Back
Top