-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
thin install - systemD support #184
base: master
Are you sure you want to change the base?
Conversation
Are you your service is working fine? I tried your service file and it didn't work. I'm currently investigating. |
@pothibo did you get it working? If you got a working config, I'll integrate it into Thin. |
Sorry I forgot about it. The issue with systemd and ruby is that there are tools like rvm, rbenv and such that handles ruby version. This is what was going on with my system. I'm not sure what the best approach would be. Maybe you can give me some idea? Right now, here's the service I'm using. [Unit]
Description=lamarmite.ca Thin instance
After=syslog.target network.target
[Service]
Type=simple
User=marmite
Group=http
Environment="PATH=/usr/local/share/npm/bin:/opt/rubies/ruby-2.0.0-p247/bin:$PATH"
WorkingDirectory=/home/marmite/
ExecStart=/home/marmite/.gem/ruby/2.0.0/bin/thin start --ssl -R /srv/http/marmite.ca/config.ru -e production
[Install]
WantedBy=multi-user.target |
I would prefer starting thin in userspace, e.g. |
@pirj it was my understanding that setting a user & group would run the service as the specified user/group. |
@pothibo Makes sense |
I suggest file format strongly depends on how gems are bundled and is rvm installed.
The following webapp.service works fine (start, stop, restart):
If I set Should it listen to unix socket or port by default? Can we do both? Or is it a good idea to insist on socket usage? |
Honestly, I have no idea, I meant to submit a PR here for a long time, but there's two things that are bothering me. ExecStart needs to include absolute path. Maybe it should try to find the correct paths and ask for the user for a confirmation? I guess @macournoyer would be better positionned to answer those questions though. |
@pothibo If you're using with rvm, rather than handling with 'thin install', you should follow this guide - http://rvm.io/deployment . |
FYI this systemd service works perfectly for me:
|
hi, any news about this? |
Can you please rebase this on master. |
As discussed on google groups, many modern linux systems have migrated from old SystemVinit to SystemD, which makes our install script outdated
This is the commit that autodetects which one of them is in use and make the change appropriately.
p.s.: I have tried to conform to the existing coding style.