Skip to content
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

scrapyd no longer provides an easy way to do a system install #258

Closed
Digenis opened this issue Nov 20, 2017 · 1 comment
Closed

scrapyd no longer provides an easy way to do a system install #258

Digenis opened this issue Nov 20, 2017 · 1 comment

Comments

@Digenis
Copy link
Member

Digenis commented Nov 20, 2017

Even before the ubuntu packages got deprecated (#252)
the scrapyd builds for ubuntu/debian where quite unusable.

We should have instructions on how to do a system install.
The current steps, as seen in the debian/ folder
are as follows:

To a seasoned sysadmin, it's a matter of minutes.
The fancy part is to set up a python environment
to be used by the scrapyd user and its init script.
This is necessary as scrapyd may not agree
with the packages or package versions
used by the system python.
(also, not all required python packages may be system packages)

@Digenis Digenis changed the title scrapyd no longer provides an easy way to do a system instal scrapyd no longer provides an easy way to do a system install Nov 20, 2017
@jpmckinney
Copy link
Contributor

jpmckinney commented May 13, 2022

There is nothing very special about making it a system service. For example, most of the following is already documented:

  1. Create a user to run Scrapyd
  2. Create Scrapyd's configuration file in the user's home directory (example)
  3. Create any directories mentioned in the configuration file (eggs, dbs, logs), owned by that user
  4. Install Scrapyd (e.g. in a virtual environment in the user's home directory)
  5. Create /etc/systemd/system/scrapyd.service, if you like to use systemd

It can look like:

[Unit]
Description=Scrapyd
After=network.target

[Service]
User=myuser
Group=mygroup
UMask=2002
# Add any environment variables you want.
Environment="key=value"
WorkingDirectory=/home/scrapyd/scrapyd
ExecStart=/home/scrapyd/scrapyd/.ve/bin/scrapyd --nodaemon --logfile=/var/log/scrapyd/scrapyd.log
LimitNOFILE=512000

[Install]
WantedBy=multi-user.target

If using the above, you will need to create /var/log/scrapyd/, owned by the user.

The only undocumented part is the systemd.service file, but these are easy to write if you read systemd's documentation. There are many service managers – I don't think it's our responsibility to document them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants