Disabling anydesk autostart on sysvinit
Posted: Thu Dec 03, 2020 10:24 am
Problem: anydesk [remote desktop software] always autostarts with the system. This is highly undesirable in some cases (although it is desirable in others).
Dilemma: Instructions are widely available online on how to disable anydesk autostart on systemd distros and on Mac and Windows machines, but not for sysvinit. The systemd instructions do not work on sysvinit, nor do the Mac or Windows instructions.
Solution: The only solution I've been able to figure out that works is to delete the "S03anydesk" file from runlevels 2 through 5:
/etc/rc2.d/S03anydesk
/etc/rc3.d/S03anydesk
/etc/rc4.d/S03anydesk
/etc/rc5.d/S03anydesk
UPDATE - per advice from @dolphin_oracle, here is the best solution:
1. Edit /etc/init.d/anydesk with editor of choice to remove runlevels from the headers for the Default-Start line. Change from:
Change to the following, deleting runlevels 2, 3, 4 and 5 from Default-Start:
2. Save, close the editor, and run the following commands:
This removes the instructions for the anydesk service to be started with runlevels 2,3,4,5. After this change and rebooting, anydesk no longer autostarts, but the anydesk service still starts and runs fine when manually starting from the XFCE menu.
Issue: [UPDATE - Issue resolved, no longer a concern] Not sure if this will cause any damage to the system, as I'm not very knowledgeable about sysvinit runlevel scripts. I may be doing something wildly wrong here, but just wanted to start the conversation. Please jump in and tell me if this is incorrect procedure or likely to cause damage to the system.
Dilemma: Instructions are widely available online on how to disable anydesk autostart on systemd distros and on Mac and Windows machines, but not for sysvinit. The systemd instructions do not work on sysvinit, nor do the Mac or Windows instructions.
Solution: The only solution I've been able to figure out that works is to delete the "S03anydesk" file from runlevels 2 through 5:
/etc/rc2.d/S03anydesk
/etc/rc3.d/S03anydesk
/etc/rc4.d/S03anydesk
/etc/rc5.d/S03anydesk
UPDATE - per advice from @dolphin_oracle, here is the best solution:
1. Edit /etc/init.d/anydesk with editor of choice to remove runlevels from the headers for the Default-Start line. Change from:
Code: Select all
### BEGIN INIT INFO
# Provides: anydesk
# Required-Start: $dbus udev networking
# Required-Stop: $dbus udev networking
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: AnyDesk global service
# Description: AnyDesk global service
### END INIT INFO
Code: Select all
### BEGIN INIT INFO
# Provides: anydesk
# Required-Start: $dbus udev networking
# Required-Stop: $dbus udev networking
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start:
# Default-Stop: 0 1 6
# Short-Description: AnyDesk global service
# Description: AnyDesk global service
### END INIT INFO
Code: Select all
sudo update-rc.d anydesk remove
sudo update-rc.d anydesk defaults
Issue: [UPDATE - Issue resolved, no longer a concern] Not sure if this will cause any damage to the system, as I'm not very knowledgeable about sysvinit runlevel scripts. I may be doing something wildly wrong here, but just wanted to start the conversation. Please jump in and tell me if this is incorrect procedure or likely to cause damage to the system.