Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Run script on user login

  1. #1

    Default Run script on user login

    Hi, I've created symlinks, that redirect all the .config, .cache, .kde4, recent files and so... simply all the trails that KDE leaves behind to the ramdisk (/run/user/1000) and it works fine. But to make symlinks work I have to create folders on the ramdisk first when I start the computer, otherwise login via KDE gui does not work (it hangs and I have to kill it when I forget to login via tty1 first). I cannot figure where to put my script with mkdirs to make it work properly. I need it to run just after ecryptfs mounts my home folder. Currently I have the script in /etc/profile.d and it works, but I have to login via tty first (ctrl+alt+f1), logout, then ctrl+alt+f7 to switch to the GUI tty7 and login via KDE. It is a bin inconvenient. :-(
    Btw. from what config file is actually the ecryptfs invoked? I looked into /etc/rc.d and /etc/init.d and it is empty, there's not even skeleton now

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,840

    Default Re: Run script on user login

    Quote Originally Posted by pruda View Post

    Btw. from what config file is actually the ecryptfs invoked? I looked into /etc/rc.d and /etc/init.d and it is empty, there's not even skeleton now
    Apart from your original question (which I thinjk will not be to easy to answer because I assume the designers never had such a thing in mind when designing GUI login, let alone that they provided easy hooks), I can explain why /etc/rc.d and etc/init.d are empty. They are not used anymore because openSUSE already some time ago switched to systemd.

    Maybe a user (not system) systemd unit could help you in your problem though.
    Henk van Velden

  3. #3

    Default Re: Run script on user login

    Quote Originally Posted by hcvv View Post
    I assume the designers never had such a thing in mind when designing GUI login
    Hello and thank you for reply, but I'm sure there's a mechanism that makes this possible, otherwise ecryptfs could not mount the needed files on login and GUI would hang too.

    I try to look onto suggested user systemd, but before I try to reinvent the wheel, maybe someone knows how this works?

  4. #4

    Default Re: Run script on user login

    If this is a single user system and you are using xdm then you can try placing this in /etc/X11/xdm/Xsetup
    I don’t have anything to hide, but I don’t have anything I want to show you either.

  5. #5
    Join Date
    Sep 2012
    Posts
    7,107

    Default Re: Run script on user login

    Quote Originally Posted by pruda View Post
    otherwise ecryptfs could not mount the needed files on login
    That's normally what pam_ecryptfs is for.

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,840

    Default Re: Run script on user login

    Quote Originally Posted by pruda View Post
    Hello and thank you for reply, but I'm sure there's a mechanism that makes this possible, otherwise ecryptfs could not mount the needed files on login and GUI would hang too.
    Hm, yes, I see why you are looking into that mechanism.

    Others tune in now. All together may succeed in solving this
    Henk van Velden

  7. #7

    Default Re: Run script on user login

    Quote Originally Posted by d3vnull View Post
    If this is a single user system and you are using xdm then you can try placing this in /etc/X11/xdm/Xsetup
    Thanks for suggestion, I tried to put mkdirs there, but it does not work. Either there's no ramdisk (yet) when this is executed, or I'm not using xdm. KDE Plasma uses sddm I think. Btw. you would not believe, why I prefer KDE over gnome: I was unable to move taskbar from top to bottom Btw2 I like your footer

    Quote Originally Posted by arvidjaar View Post
    That's normally what pam_ecryptfs is for.
    Ok, but who is that someone who tells him the user is about to login and to act? ;-)

    Quote Originally Posted by hcvv View Post
    Hm, yes, I see why you are looking into that mechanism.

    Others tune in now. All together may succeed in solving this
    Thanks, I hope someone knows. And yes, I'm aware what does curiosity do to cats

  8. #8

    Default Re: Run script on user login

    Looking at this:

    https://jlk.fjfi.cvut.cz/arch/manpages/man/sddm.conf.5

    Can you modify: /usr/share/sddm/scripts/Xsetup
    I don’t have anything to hide, but I don’t have anything I want to show you either.

  9. #9
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,685
    Blog Entries
    3

    Default Re: Run script on user login

    Firstly, your "ecryptfs" file system is mounted via pam. So that happens during login.

    Secondly: your user shell startup script (probably ".bashrc") is run during session startup. The trick is to put some cross checks in there so that you only do your special stuff when needed, and skip it for other times that your user shell is started.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  10. #10

    Default Re: Run script on user login

    Quote Originally Posted by d3vnull View Post
    Looking at this:

    https://jlk.fjfi.cvut.cz/arch/manpages/man/sddm.conf.5

    Can you modify: /usr/share/sddm/scripts/Xsetup
    The default config shipped in openSUSE's sddm package explicitly configures it to use /etc/X11/xdm/Xsetup instead.
    See /usr/lib/sddm/sddm.conf.d/00-general.conf .

    But: /run/user/xxx/ is created dynamically on login (by PAM), so it probably doesn't exist yet when Xsetup is run.

    No idea how to best create subdirectories there though...
    Last edited by wolfi323; 30-May-2018 at 08:10.

Page 1 of 2 12 LastLast

Posting Permissions

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