The officially official Devuan Forum!

You are not logged in.

#1 2022-04-21 11:57:45

draden
Member
Registered: 2022-04-21
Posts: 2  

[SOLVED] How to auto-start an application during booting

I would like to enable the firewall (ufw) and also TOR on my system's startup (Chimaera). I found that i need to update rc.local and add the following:

    if [ -x /lib/ufw/ufw-init ]; then
    /lib/ufw/ufw-init start
    fi

Is that correct? Can someone help me how to configure these two process correctly? Also, openvpn auto-connect would be great. Now I am using cd /etc/openvpn sudo openvpn ....ovpn command in terminal.

Thanks!

Last edited by draden (2022-04-21 12:02:04)

Offline

#2 2022-04-21 12:46:58

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 587  

Re: [SOLVED] How to auto-start an application during booting

I have done this.
Type in a console terminal... as root

 rc-update

you should get a list of services and their start-up status. like sysinit, default, off, recovery. (sorry it looks messy)

root@GlennsPref:/root  rc-update
           alsa-utils |                                              sysinit
              anacron |      default                                        
         avahi-daemon |                        off                          
            bluetooth |      default                                        
             bootlogd |                                              sysinit
             bootlogs |      default               recovery                 
          bootmisc.sh |                                              sysinit
           brightness |                                              sysinit
              cgroups |                                              sysinit
           checkfs.sh |                                              sysinit
 checkroot-bootclean.sh |                                              sysinit
         checkroot.sh |                                              sysinit
     clamav-freshclam |      default                                        
     console-setup.sh |      default                                        
                 cron |      default                                        
                 dbus |      default                                        
              elogind |      default                                        
                eudev |                                              sysinit
                exim4 |                        off                          
             fail2ban |      default                                        
            fwautorun |                                              sysinit
           fwlogwatch |      default                                        
                  gpm |      default                                        
              hddtemp |      default                                        
          hostname.sh |                                              sysinit
           hwclock.sh |                                              sysinit
    keyboard-setup.sh |                                              sysinit
            killprocs |                            recovery                 
                 kmod |                                              sysinit
              lightdm |      default                                        
           lm-sensors |                                              sysinit
       mount-configfs |                                              sysinit
 mountall-bootclean.sh |                                              sysinit
          mountall.sh |                                              sysinit
     mountdevsubfs.sh |                                              sysinit
       mountkernfs.sh |                                              sysinit
 mountnfs-bootclean.sh |                                              sysinit
          mountnfs.sh |                                              sysinit
       nethack-common |                        off                          
      network-manager |      default                                        
           networking |                                              sysinit
             openntpd |      default                                        
              privoxy |      default                                        
               procps |                                              sysinit
 pulseaudio-enable-autospawn |      default           off                          
             rc.local |      default                                        
            rmnologin |      default                                        
                rsync |      default                                        
              rsyslog |      default                                        
            savecache |                        off                          
       screen-cleanup |                                              sysinit
             sendsigs |                        off                          
               single |                            recovery                 
                 slim |      default                                        
                squid |      default                                        
                  ssh |                        off                          
        stop-bootlogd |      default                                        
 stop-bootlogd-single |                                              sysinit
                 sudo |                        off                          
              sysstat |      default                                        
             umountfs |                        off                          
         umountnfs.sh |                        off                          
           umountroot |                        off                          
              urandom |                                              sysinit
           x11-common |                                              sysinit
                  xdm |      default 

Also you can use this to see the status of the services.

service --status-all
root@GlennsPref:/root  service
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]
root@GlennsPref:/root  service --status-all
 [ ? ]  alsa-utils
 [ - ]  anacron
 [ - ]  avahi-daemon
 [ + ]  bluetooth
 [ + ]  bootlogd
 [ - ]  bootlogs
 [ - ]  bootmisc.sh
 [ - ]  brightness
 [ + ]  cgroups
 [ - ]  checkfs.sh
 [ - ]  checkroot-bootclean.sh
 [ - ]  checkroot.sh
 [ + ]  clamav-freshclam
 [ - ]  console-setup.sh
 [ + ]  cron
 [ + ]  dbus
 [ + ]  elogind
 [ + ]  eudev
 [ - ]  exim4
 [ + ]  fail2ban
 [ ? ]  fwautorun
 [ + ]  fwlog.sh
 [ - ]  fwlogwatch
 [ + ]  gpm
 [ - ]  hddtemp
 [ - ]  hostname.sh
 [ ? ]  hwclock.sh
 [ - ]  iwd.initd
 [ - ]  keyboard-setup.sh
 [ - ]  killprocs
 [ ? ]  kmod
 [ + ]  lightdm
 [ - ]  lm-sensors
 [ ? ]  mount-configfs
 [ - ]  mountall-bootclean.sh
 [ - ]  mountall.sh
 [ - ]  mountdevsubfs.sh
 [ - ]  mountkernfs.sh
 [ - ]  mountnfs-bootclean.sh
 [ - ]  mountnfs.sh
 [ - ]  nethack-common
 [ + ]  network-manager
 [ ? ]  networking
 [ - ]  openntpd
 [ + ]  privoxy
 [ - ]  procps
 [ - ]  pulseaudio-enable-autospawn
 [ - ]  rc.local
 [ - ]  rmnologin
 [ - ]  rsync
 [ + ]  rsyslog
 [ - ]  savecache
 [ - ]  screen-cleanup
 [ - ]  sendsigs
 [ - ]  slim
 [ + ]  squid
 [ - ]  ssh
 [ + ]  stop-bootlogd
 [ + ]  stop-bootlogd-single
 [ - ]  sudo
 [ - ]  sysstat
 [ - ]  umountfs
 [ - ]  umountnfs.sh
 [ - ]  umountroot
 [ - ]  urandom
 [ - ]  x11-common
 [ - ]  xdm

If your service is not listed to start you can add or del it from the list and run it, like this (for example)

rc-update add nftables default
rc-service nftables start

for the oposite, change add to del, and change start to stop.

I hope I got the question right, all the best. Glenn


pic from 1993, new guitar day.

Offline

#3 2022-04-21 22:48:03

MiyoLinux
Member
Registered: 2016-12-05
Posts: 1,323  

Re: [SOLVED] How to auto-start an application during booting

I just run the following commands as root...

ufw default deny
ufw enable

After that second command, it shows a message saying that ufw is enabled and added to system startup.

...and you can check if it's  running with...

ufw status

I have been Devuanated, and my practice in the art of Devuanism shall continue until my Devuanization is complete. Until then, I will strive to continue in my understanding of Devuanchology, Devuanprocity, and Devuanivity.

Veni, vidi, vici vdevuaned. I came, I saw, I Devuaned. wink

Offline

Board footer