# Doppler with systemd problem

**URL:** <https://community.doppler.com/t/doppler-with-systemd-problem/1233>\
**Category:** Need Help\
**Created:** [July 10, 2023, 6:45am UTC](https://community.doppler.com/t/doppler-with-systemd-problem/1233 "2023-07-10T06:45:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![swasher](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/swasher/32/832_2.png) [@swasher](https://community.doppler.com/u/swasher)\
**Post date:** [July 10, 2023, 6:45am UTC](https://community.doppler.com/t/doppler-with-systemd-problem/1233/1 "2023-07-10T06:45:43Z")

</div>

First of all, I want express gratitude to developers of Doppler for very cool and convenient tool!

I’m trying use doppler with Django application, which run in production with `gunicorn` and `systemd`. Python virtual envitonment maintaining with `pipenv`, so full working config look as:

**gunicorn.socket**

```auto
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
Type=notify
User=swasher
Group=www-data
RuntimeDirectory=gunicorn
WorkingDirectory=/home/swasher/printMES

ExecStart=/usr/bin/pipenv run gunicorn \
            --access-logfile - \
            --bind 0.0.0.0:8000 \
            --workers 3 \
            --bind unix:/home/swasher/printMES/gunicorn.sock \
            printMES.wsgi:application

ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true

[Install]
WantedBy=multi-user.target

```

At this point, my config is working well.  
Now, I’m added `doppler` injection, so ExecStart became as

```auto
ExecStart=doppler run -- /usr/bin/pipenv run gunicorn \
            --access-logfile - \
            --bind 0.0.0.0:8000 \
            --workers 3 \
            --bind unix:/home/swasher/printMES/gunicorn.sock \
            printMES.wsgi:application

```

Then I start the service with following command:

```shell
# sudo systemctl start gunicorn.service

```

it will start sucessfully (django can get all doppler’s variables and my site running fine), but with the one problem: **command do not return to shell.**  
And via about a minute it’s drop with following error:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/doppler/original/1X/58ddeac7b41ecc4dc62f1832740e36323fc4c44c.png)

Any log do not have any usefull information, with the exception of `The unit gunicorn.service has entered the 'failed' state with result 'timeout'.`

Do you have any idea how to make it work?

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [July 11, 2023, 7:27pm UTC](https://community.doppler.com/t/doppler-with-systemd-problem/1233/2 "2023-07-11T19:27:38Z")

</div>

Hi @swasher!

Welcome to the Doppler Community!

Sorry for the delay getting back to you. I had to setup a test environment from scratch for this. I believe the issue you’re hitting is with this:

```auto
Type=notify

```

That indicates that systemd should wait for the starting application to issue a notification when it’s done starting up. When you’re starting using the `doppler` binary, no such notification is sent, so it just hangs forever. If you comment that line out (so it defaults to `simple` rather than `notify`), everything works as expected.

Could you give that a shot and see if it works for you?

Regards,  
-Joel

---

<div class="post-metadata">

**Author:** ![swasher](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/swasher/32/832_2.png) [@swasher](https://community.doppler.com/u/swasher)\
**Post date:** [July 12, 2023, 7:25am UTC](https://community.doppler.com/t/doppler-with-systemd-problem/1233/3 "2023-07-12T07:25:30Z")

</div>

Thank you for your help!  
I need more time for testing, but at first look, problem is solved!

At least, service started successfully, and `systemctrl start gunicorn...` return to shell as well.
