ravenclaw900 / DietPi-Dashboard

A lightweight, standalone web dashboard for DietPi
GNU General Public License v3.0
125 stars 17 forks source link

Temporary Disable(mask/unmask) the dietpi controlled application #46

Open id4vip opened 2 years ago

id4vip commented 2 years ago

I just want to request please add these four commands for all dietpi installed software in dietpi-dashboard.

systemctl stop proftpd

systemctl start proftpd

systemctl mask proftpd

systemctl unmask proftpd

as in my system I have installed proftpd, dropbear, samba share etc. Mostly these item I do not need. As if in dietpi-dashboard these commands added then it is very handy to stop ideal programs. I know stop command already showed in dietpi-dashboard, I want to request please add mask/unmask option also. As even if I stop that application through dietpi-dashboard after reboot it again online only mask/unmask command temporary suspend restarting of application after reboot.

Thanks

ravenclaw900 commented 2 years ago

Hello, To be clear, along with stop/start, you also want mask/unmask shown in the Services page?

id4vip commented 2 years ago

yes, exactly that thing. with that it is very handy to temporary suspend all unneeded applications. & whenever that application needed just switch on that through dietpi-dashboard. it will help reduce hardware resources in long run as well as less active applications reduce system hacking exposure.

MichaIng commented 2 years ago

Good idea. I want to get rid of the dietpi-services startup at boot but have all services "enabled" instead and regularly started by systemd. This just requires a lot of "After=" additions to the systemd units to assure backends/databases are started before frontend applications. When this is done, enable/disable switch to not start a service at boot would be great as well. That way it it can be still started manually without the need to first unmask it.


Ah, one note about masking: When a service file is located in /etc/systemd/system, it cannot be masked, since this is the location where the symlink to /dev/null would be created. This is the case for all systemd units which are not shipped by packages or installers but created by dietpi-software itself as an addition or overwrite. We may move services to /usr/local/lib/systemd/system for that reason, but this is not yet the case. So this is something to keep in mind. Probably the existence of the file in /etc/systemd/system could be even checked and the mask/unmask switch hidden in this case.