home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux.suse      Suse is actually not that bad      138,051 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 136,106 of 138,051   
   Carlos E.R. to Paulo da Silva   
   Re: init script   
   28 Jan 17 18:33:10   
   
   From: robin_listas@invalid.es   
      
   On 2017-01-28 05:03, Paulo da Silva wrote:   
   > Hi all!   
   >   
   > I need to launch a bash script just after mounts and another (or the   
   > same with "stop") before umounts during boot/shutdown process.   
   >   
   > Does anybody know how to do this on OS 42.2?   
      
   You have these:   
      
   Isengard:~ # ls /etc/init.d/*local   
   /etc/init.d/after.local  /etc/init.d/boot.local  /etc/init.d/halt.local   
   Isengard:~ #   
      
   The comments on those files tell you when they are run.   
      
   Either that, or create your own systemd service file; that way it may   
   run precissely after filesystems are mounted. I don't know the correct   
   target, though. Maybe "after local-fs.target"   
      
      
      
   > A simple template would be nice. I don't want want to go thru the   
   > process of understanding/learning systemd, at least for now.   
      
      
   Maybe (untested):   
      
   /etc/systemd/system/mine.service   
      
   Unit]   
   Description=Runs my things after mounting files   
   After=local-fs.target   
      
   [Service]   
   Type=oneshot   
   RemainAfterExit=true   
   ExecStart=-/usr/local/bin/mine   
      
   [Install]   
   WantedBy=local-fs.target   
      
      
      
   --   
   Cheers, Carlos.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca