# Run a specific script

**URL:** <https://discourse.jupyter.org/t/run-a-specific-script/4718>\
**Category:** JupyterHub\
**Created:** [June 5, 2020, 7:55am UTC](https://discourse.jupyter.org/t/run-a-specific-script/4718 "2020-06-05T07:55:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![manu](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manu/32/2207_2.png) [@manu](https://discourse.jupyter.org/u/manu)\
**Post date:** [June 5, 2020, 7:55am UTC](https://discourse.jupyter.org/t/run-a-specific-script/4718/1 "2020-06-05T07:55:56Z")

</div>

Hi,  
Is it possible to launch a specific script for each connection by user ?  
My idea is to reset the workspace of a user with a default workspace.

Thanks,

Manu

---

<div class="post-metadata">

**Author:** ![1kastner](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/1kastner/32/1537_2.png) [@1kastner](https://discourse.jupyter.org/u/1kastner)\
**Post date:** [June 5, 2020, 11:18am UTC](https://discourse.jupyter.org/t/run-a-specific-script/4718/2 "2020-06-05T11:18:52Z")

</div>

Which spawner do you use? There are different hooks you might want to use.

---

<div class="post-metadata">

**Author:** ![manu](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manu/32/2207_2.png) [@manu](https://discourse.jupyter.org/u/manu)\
**Post date:** [June 5, 2020, 11:36am UTC](https://discourse.jupyter.org/t/run-a-specific-script/4718/3 "2020-06-05T11:36:21Z")

</div>

> [@1kastner](#):
>
> spawner

I do not use a spawner, I will look at this option .  
thanks

---

<div class="post-metadata">

**Author:** ![manu](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manu/32/2207_2.png) [@manu](https://discourse.jupyter.org/u/manu)\
**Post date:** [June 8, 2020, 8:19am UTC](https://discourse.jupyter.org/t/run-a-specific-script/4718/4 "2020-06-08T08:19:53Z")

</div>

I solved my problem by setting the variable :  
c.JupyterHub.shutdown\_on\_logout = True  
and inserting a command in the jupyter\_notebook\_config.py of each student, the only problem if the student does not logout, his server remains active and does not take not take into account the modifications.

---

<div class="post-metadata">

**Author:** ![1kastner](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/1kastner/32/1537_2.png) [@1kastner](https://discourse.jupyter.org/u/1kastner)\
**Post date:** [June 8, 2020, 8:42am UTC](https://discourse.jupyter.org/t/run-a-specific-script/4718/5 "2020-06-08T08:42:07Z")

</div>

This is one of the difficulties of administration. You could of course also manually enter each docker container and update these for the users. Anyhow, if people have already significantly changed their docker container, then anyways you will run into troubles. So you might just think about forcing a logout of all users, e.g. by invalidating their login, see [How to force re-login for users](https://discourse.jupyter.org/t/how-to-force-re-login-for-users/1998) for more information on that.
