Difference between revisions of "Running scripts at GUI login or log-off"

From Notes_Wiki
(Created page with "=Running scripts at GUI login or log-off= Some times it is desired that scripts run automatically after every GUI login / log-off. We cannot use '<tt>/etc/rc.d/rc.local</tt>'...")
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
=Running scripts at GUI login or log-off=
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Miscellaneous OS configuration]] > [[Running scripts at GUI login or log-off]]


Some times it is desired that scripts run automatically after every GUI login / log-off. We cannot use '<tt>/etc/rc.d/rc.local</tt>' for such cases as that would cause script to run at system start-up and only once and not at every user login/log-off.
Some times it is desired that scripts run automatically after every GUI login / log-off. We cannot use '<tt>/etc/rc.d/rc.local</tt>' for such cases as that would cause script to run at system start-up and only once and not at every user login/log-off.


For such cases we can edit file '<tt>/etc/gdm/PreSession/Default</tt>' or '<tt>/etc/gdm/PostSession/Default</tt>' and enter full path of scripts to be executed before GUI login or after log-off respectively. These scripts would be run as root user and hence would allow all types of configuration to be done without facing permission issues.
For such cases we can edit file '<tt>/etc/gdm/PreSession/Default</tt>' or '<tt>/etc/gdm/PostSession/Default</tt>' and enter full path of scripts to be executed before GUI login or after log-off respectively. These scripts would be run as root user and hence would allow all types of configuration to be done without facing permission issues.
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Miscellaneous OS configuration]] > [[Running scripts at GUI login or log-off]]

Latest revision as of 15:48, 22 July 2022

Home > CentOS > CentOS 6.x > Miscellaneous OS configuration > Running scripts at GUI login or log-off

Some times it is desired that scripts run automatically after every GUI login / log-off. We cannot use '/etc/rc.d/rc.local' for such cases as that would cause script to run at system start-up and only once and not at every user login/log-off.

For such cases we can edit file '/etc/gdm/PreSession/Default' or '/etc/gdm/PostSession/Default' and enter full path of scripts to be executed before GUI login or after log-off respectively. These scripts would be run as root user and hence would allow all types of configuration to be done without facing permission issues.


Home > CentOS > CentOS 6.x > Miscellaneous OS configuration > Running scripts at GUI login or log-off