Results 1 to 5 of 5

Thread: need a file auto deleted every shutdown

  1. #1
    Join Date
    Jan 2010
    Location
    TEXAS
    Beans
    53
    Distro
    Ubuntu 10.04 Lucid Lynx

    Thumbs down need a file auto deleted every shutdown

    Im running a flavor of Ubuntu 10.04 Lucid. I have it installed on a 16G persistent flash drive. with only the boot file not encrypted I use this on many different laptops and computers for the tools that i have installed on this build. For me to be able to get wifi or local connection i have to delete the file located at

    "/etc/udev/rules.d/70-persisten-net.rules"

    then reboot. Is there any way i can have this file auto delete on shut down. The file is auto regend if missing at reboot. When it regens the network connection either wifi or local area works on what every laptop or desktop that i am using.

    i thought about cron but that is a time thing and i dont think i can make it run at shutdown. What i am wanting to do is add a line in to the shutdown files to tell the OS to delete that file before it sends all its kill sig.

    now is this possible and if so what file and maybe want line number do i need to edit. if not possible anyone get any ideas.
    Give me 10 MIN before trying my post cause i always forget sutff and will be editing it. Usually to add things.
    Compaq Presario C700, Ubuntu 10.04, 8.1,XP sp3 no vga driver.
    When things are fixed mark thread as solved PLEASE! It is in thread tools.

  2. #2
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    upstart

    You could put the script you want in an Upstart script and set it to run for runlevels 0 and 6.

    Code:
    ...
    start on runlevel [06]
    ...

  3. #3
    Join Date
    Jan 2010
    Location
    TEXAS
    Beans
    53
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: need a file auto deleted every shutdown

    do i need to put

    #stop on run level ??

    or just start and then my script
    Give me 10 MIN before trying my post cause i always forget sutff and will be editing it. Usually to add things.
    Compaq Presario C700, Ubuntu 10.04, 8.1,XP sp3 no vga driver.
    When things are fixed mark thread as solved PLEASE! It is in thread tools.

  4. #4
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    runlevel 0

    Runlevel 0 is shutting down, runlevel 6 is rebooting. So I think you'll want to start your script on those events. It will call for a little experimentation and there are several ways of getting the right timing. There are also pre-start and post-stop capablities. You can also tie the action to some other service's state or whether it is starting up or shutting down.

  5. #5
    Join Date
    Jan 2010
    Location
    TEXAS
    Beans
    53
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: need a file auto deleted every shutdown

    thank you very much for the info
    Give me 10 MIN before trying my post cause i always forget sutff and will be editing it. Usually to add things.
    Compaq Presario C700, Ubuntu 10.04, 8.1,XP sp3 no vga driver.
    When things are fixed mark thread as solved PLEASE! It is in thread tools.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •