You are not logged in.
Pages: 1
I've just migrated from ubuntu and so far I'm really happy with Arch. GNU/Linux really is easier to 'get' with Arch. I've been able to overcome all problems so far with reading previous posts or searching for it by other means, yet this obviously elementary broblem still defies solution.
- How do I run a script on logout?
What I want to do on logout is to run 'fusermount -u ~/mounted-dir/', where 'mounted-dir' holds media from my account on another host. I have it set up so that /etc/profile runs ~/.login which in turn runs 'sshfs me@other.host:~/media/ ~/mounted-dir/ -o sshfs_sync -o reconnect'.
- Is this a reasonable way of Getting Things Done?
I suspect (as I always do) that there might be a way these things are supposed to be done, this not being it.
Last edited by pooflinger (2007-10-05 10:05:29)
Offline
You can use a .bash_logout file
Cheers man, that worked fine! However it only works as long as I use bash as login shell right? Do you think there's a way of doing it loginshell-independantly such as /etc/profile is for login?
Offline
the problem with .bash_logout is it will run whenever you exit a bash instance.
are you using a desktop environment? do you just want this to happen prior to shutdown? or when you actually log out?
Offline
the problem with .bash_logout is it will run whenever you exit a bash instance.
are you using a desktop environment? do you just want this to happen prior to shutdown? or when you actually log out?
I pretty sure that .bash_logout only runs if $SHELL is /bin/bash when you log out. I want this to happen when I actually log out.
Last edited by pooflinger (2007-10-05 11:13:15)
Offline
You can mount/unmount sshfs shares on startup/shutdown with /etc/fstab and /etc/rc.d/netfs.
Offline
You can mount/unmount sshfs shares on startup/shutdown with /etc/fstab and /etc/rc.d/netfs.
Thanks tomk, this is excellent information.
Last edited by pooflinger (2007-10-05 20:23:56)
Offline
_adam_ wrote:the problem with .bash_logout is it will run whenever you exit a bash instance.
are you using a desktop environment? do you just want this to happen prior to shutdown? or when you actually log out?
I pretty sure that .bash_logout only runs if $SHELL is /bin/bash when you log out. I want this to happen when I actually log out.
yeah, sorry, i forgot its only executed when a login shell is used.
Offline
Pages: 1