Page 2 of 2

Re: How to execute script with sudo using session and startup?

Posted: Sun Jan 19, 2020 11:24 am
by Head_on_a_Stick
acecombat2 wrote: Sun Jan 19, 2020 10:17 am If I understood correctly, following dolphin_oracle instruction automatically the script will run as part of systemd boot sequence?
Actually you can just use systemctl to enable it.

I saved your script to /etc/init.d/vbox and made it executable then:

Code: Select all

empty@mx:~
$ sudo systemctl enable --now vbox
vbox.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable vbox
empty@mx:~
$ systemctl is-enabled vbox
vbox.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install is-enabled vbox
enabled
empty@mx:~
$
Seems to work :-)

Re: How to execute script with sudo using session and startup?

Posted: Sun Jan 19, 2020 5:35 pm
by fehlix
acecombat2 wrote: Sun Jan 19, 2020 10:17 am If I understood correctly, following dolphin_oracle instruction automatically the script will run as part of systemd boot sequence? I'm still in learning curve albeit, slowly.
If you installed the sysvinit (init.d) script when booted with sysvinit - not with systemd -, the systemd entries will also be generated to be available when booted with systemd.

Re: How to execute script with sudo using session and startup?

Posted: Sun Jan 19, 2020 6:48 pm
by acecombat2
Head_on_a_Stick wrote: Sun Jan 19, 2020 11:24 am
acecombat2 wrote: Sun Jan 19, 2020 10:17 am If I understood correctly, following dolphin_oracle instruction automatically the script will run as part of systemd boot sequence?
Actually you can just use systemctl to enable it.

I saved your script to /etc/init.d/vbox and made it executable then:

Code: Select all

empty@mx:~
$ sudo systemctl enable --now vbox
vbox.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable vbox
empty@mx:~
$ systemctl is-enabled vbox
vbox.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install is-enabled vbox
enabled
empty@mx:~
$
Seems to work :-)
Nifty! Thank you for showing to me of how to do it. am not ready yet to delve in hacking sysvinit shell script into systemd unit.

fehlix wrote: Sun Jan 19, 2020 5:35 pm
acecombat2 wrote: Sun Jan 19, 2020 10:17 am If I understood correctly, following dolphin_oracle instruction automatically the script will run as part of systemd boot sequence? I'm still in learning curve albeit, slowly.
If you installed the sysvinit (init.d) script when booted with sysvinit - not with systemd -, the systemd entries will also be generated to be available when booted with systemd.
Got it. Now we have 3 options to go about it.

I'm going to try with these alternatives.