× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Re: how to get rid of Mysql systemctl

Dewdman42
Virtuoso

how to get rid of Mysql systemctl

At some point I installed the MySQL addon and removed it later when I decided to use postgres.  However, MySQL is still left running on my system and enabled as a systemctl service, even after reboot.  if I stop it and disable it with systemctl, it comes back on the next reboot.  

 

Is MySQL required to be running on Readynas OS6 in order to support some basic services?  I didn't install any addons that make use of it I don't think, all I did was install the MySQL addon, and PHPMyAdmin, but i never even went in there and created a DB or anything.  I removed both addons, but mysql is still around.

 

What gives?

 

I am finding the same problem with leafp2p, when I stop and disable that systemctl service, after reboot its back running again.  These things are getting bootstrapped into systemctl somehow...perhaps by readynasd, I don't know.  Can anyone explain this or help me to get rid of MySQL (and leafp2p)?

 

Message 1 of 13
siigna
NETGEAR Expert

Re: how to get rid of Mysql systemctl

@Dewdman42 wrote:

At some point I installed the MySQL addon and removed it later when I decided to use postgres.  However, MySQL is still left running on my system and enabled as a systemctl service, even after reboot.  if I stop it and disable it with systemctl, it comes back on the next reboot.

The "MySql Server" app is just like the "Postgresql 9.1" app. Simply a meta-package to install the version from Debian. Removing the app will only remove files from the app package itself, not the dependent packages.  So on app uninstall you still have the Debian package installed.

 

MySQL doesn't install a systemd service, systemd is just translating the init script, so enable/disable won't work.  You need to update-rc.d mysql disable.

Is MySQL required to be running on Readynas OS6 in order to support some basic services?  I didn't install any addons that make use of it I don't think, all I did was install the MySQL addon, and PHPMyAdmin, but i never even went in there and created a DB or anything.  I removed both addons, but mysql is still around.

MySQL is not required for core NAS functionality.  Some apps depend on MySQL, same story as above. If they're depending on the Debian package it won't get removed on app uninstall.

I am finding the same problem with leafp2p, when I stop and disable that systemctl service, after reboot its back running again.  These things are getting bootstrapped into systemctl somehow...perhaps by readynasd, I don't know.  Can anyone explain this or help me to get rid of MySQL (and leafp2p)?

You don't have any of the leafp2p dependent services enabled, do you?  Replicate, Remote, ReadyCLOUD...

 

Message 2 of 13
Dewdman42
Virtuoso

Re: how to get rid of Mysql systemctl

Yes I tried to use systemctl disable on everything mentioned.  They came back on boot.  No I don't have any cloud services enabled.  I may have TRIED to enable ReadyCloud once, but it didn't work and I turned it off in front view.

 

what I can say is that numerous addons leave Sh__T hanging around..that's all i can say.  I'm going to do a factory reset and be careful not to install anything I don't want to get stuck with, like mysql, readycloud, rsyslog, etc.

 

 

 

 

Message 3 of 13
siigna
NETGEAR Expert

Re: how to get rid of Mysql systemctl

I edited my reply above.  systemd will translate init.d service so you can start and stop them, but enable and disable won't work.  Need to use update-rc.d.  I suspect the leafp2p issue is the same.

Message 4 of 13
Dewdman42
Virtuoso

Re: how to get rid of Mysql systemctl

so...

 

update-rc.d mysql remove

 

, oughta get rid of mysql it sounds like.  Got rid of rsyslog with that too.  hopefully between that and the systemctl disable, they are both gone now.

 

 

 

 

Message 5 of 13
Dewdman42
Virtuoso

Re: how to get rid of Mysql systemctl

let me ask you a question since you sound knowledgable.  Why are some of those services being added both to the init.d service area as well as systemd?  I added my own systemd service unit to startup stunnel and I didn't have to add anythign under the rc-d area at all...it just seems to work.  Why do those others use both?

Message 6 of 13
Dewdman42
Virtuoso

Re: how to get rid of Mysql systemctl

Also I am trying to figure out how addons have their services added to systemctl.  When I inspected the postgresql addon control postinst script, I see the following command:

 

event_push app readynasd '<add-s resource-type="LocalApp" resource-id="LocalApp"><LocalApp appname="postgresql-readynas" success="1" reboot="1"/></add-s>' 0 0

This seems to pass itself to readynasd for registration somewhere.  Aside from that, the postinst script doesn't have any code to enable the systemd service unit.  The .service file is there in the /apps/postgresql_readynas/ folder, and it gets moved into systemd, but not explicitly by this script.  Does readynasd move .service files automatically from an /apps/<appname> dir when its present there?  If so, does that only happen when this event_push is called?  or something simillar?  After that its entirely up to systemctl to start/stop or enable/disable the service....presuming there isn't also an init.d service redundantly doing something...    Am I understanding things right?

Message 7 of 13
siigna
NETGEAR Expert

Re: how to get rid of Mysql systemctl

Some packages include init scripts, others systemd units, even others both. systemd can use both. systemd units take precedence over init scripts.

 

This explains the gory details much better than I could. 🙂
http://unix.stackexchange.com/questions/233468/how-does-systemd-use-etc-init-d-scripts

Message 8 of 13
siigna
NETGEAR Expert

Re: how to get rid of Mysql systemctl

That event_push command has actually been deprecated from the SDK and is no longer needed (SDK is being updated).  It used to let readynasd know the install went OK, but it's taken care of automatically now.

 

/apps/PACKAGE/fvapp-PACKAGE.service is automatically copied over to /lib/systemd/system on install.  The UI toggle starts and stops the systemd service.

Message 9 of 13
Dewdman42
Virtuoso

Re: how to get rid of Mysql systemctl

when you say its taken care of automatically now, what do you mean exactly?  Are you saying that readynasd sweeps through the /apps dir and looks for .service files and copies them into /lib/systemd/system/ ??  how exactly do addon service files get propogated into systemd?

 

Basically I'm trying to find out where service unit files can reside that may get implictly added back to systemd and enabled.  It sounds like if they are in an app's working dir, then this will be the case?

 

I really like systemd a lot better then the old init.d approach.  systemd by itself is very clear and explicit .  Init.d can be anybody's guess  depending on what someone writes in the init.d script.  I can understand why some legacy products will keep using init.d  What isn't clear to me is why and how init.d works together with systemd.

 

 

 

 

Message 10 of 13
siigna
NETGEAR Expert

Re: how to get rid of Mysql systemctl

After an app is installed readynasd restarts the web server (apache2).  Before the web server starts (ExecStartPre in its service file) /frontview/bin/fvapps is ran, which sweeps through the apps folder and copies service files over.


Message 11 of 13
Dewdman42
Virtuoso

Re: how to get rid of Mysql systemctl

got it.  THANKS for the explanation.  

Message 12 of 13
Dewdman42
Virtuoso

Re: how to get rid of Mysql systemctl


@siigna wrote:

Some packages include init scripts, others systemd units, even others both. systemd can use both. systemd units take precedence over init scripts.

 

This explains the gory details much better than I could. 🙂
http://unix.stackexchange.com/questions/233468/how-does-systemd-use-etc-init-d-scripts


 

Thanks for this also!  This systemd generator actually explains it all.  So if I may summarize..please correct anything wrong here:

 

  1. systemd is the bees knees and is the main conductor of everything on debian now.
  2. legacy init.d/rc.d scripts are not called directly in debian at run levels as before; but rather, during boot up, a generator reads the rc.d/init.d sym links and scripts; and generates on the fly systemd unit files which in turn call back to the actual init.d script to do whatever they need to do at the appropriate time as determined by systemd.  These get enabled implicitly in systemd and started I guess, so that systemctl will show a list of all services, including those that are native systemd units, as well as those generated ones that call back to an init.d script.
  3. new school startup scripts can be called directly by a systemd unit file without involving init.d at all, or in some cases an application could have the service unit invoke the actual init.d script.
  4. readynas has coded into apache's startup unit, a script that sweeps through /apps every time apache is restarted, and looks for appropriately named service units (fvapp*.service), and copies them into systemd, enables and starts them.

question, if I add an init.d script for something new, then is it fair to assume that the generator will not add it to systemd until reboot?  So basically I would not be able to start/stop it with systemctl until after reboot.  If I add the systemd service myself, and have it call to an init.d script, then I could obviously start/stop it from systemctl without reboot.  However, its not clear to me how the generator would be smart enough to avoid generating a duplicate unit..but anyway...overall I get the concept.  Thanks for the pointer to that post!

 

Message 13 of 13
Top Contributors
Discussion stats
  • 12 replies
  • 3501 views
  • 1 kudo
  • 2 in conversation
Announcements