Service not starting

sudo systemctl start writefreely

produces no error but …

sudo systemctl status

produces…

● learn-podgajna
    State: degraded
     Jobs: 0 queued
   Failed: 1 units
    Since: Mon 2020-12-07 11:50:58 UTC; 1 day 4h ago
   CGroup: /
           ├─user.slice 
           │ └─user-1001.slice 
           │   ├─session-35.scope 
           │   │ ├─24505 sshd: podgajnaweb [priv]
           │   │ ├─24623 sshd: podgajnaweb@pts/0
           │   │ ├─24624 -bash
           │   │ ├─24625 /usr/lib/openssh/sftp-server
           │   │ ├─24696 sudo systemctl status
           │   │ ├─24697 systemctl status
           │   │ └─24698 pager
           │   └─user@1001.service …
           │     └─init.scope 
           │       ├─24514 /lib/systemd/systemd --user
           │       └─24517 (sd-pam)
           ├─init.scope 
           │ └─1 /sbin/init
           └─system.slice 
             ├─systemd-networkd.service 
             │ └─359 /lib/systemd/systemd-networkd
             ├─systemd-udevd.service 
             │ └─188 /lib/systemd/systemd-udevd
             ├─google-clock-skew-daemon.service 
             │ └─830 /usr/bin/python3 /usr/bin/google_clock_skew_daemon
             ├─cron.service 
             │ └─537 /usr/sbin/cron -f
             ├─system-serial\x2dgetty.slice 
             │ └─serial-getty@ttyS0.service 
             │   └─840 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220
             ├─polkit.service 
             │ └─921 /usr/lib/policykit-1/polkitd --no-debug
             ├─networkd-dispatcher.service 
             │ └─551 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
             ├─google-network-daemon.service 
             │ └─806 /usr/bin/python3 /usr/bin/google_network_daemon
             ├─multipathd.service 
             │ └─303 /sbin/multipathd -d -s
             ├─accounts-daemon.service 
             │ └─521 /usr/lib/accountsservice/accounts-daemon
             ├─systemd-journald.service 
             │ └─161 /lib/systemd/systemd-journald
             ├─atd.service 
             │ └─560 /usr/sbin/atd -f
             ├─unattended-upgrades.service 
             │ └─932 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
             ├─ssh.service 
             │ └─852 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
             ├─snapd.service 
             │ └─6497 /usr/lib/snapd/snapd
             ├─mysql.service 
             │ └─12190 /usr/sbin/mysqld
             ├─rsyslog.service 
             │ └─553 /usr/sbin/rsyslogd -n -iNONE
             ├─chrony.service 
             │ ├─1946 /usr/sbin/chronyd -F -1
             │ └─1947 /usr/sbin/chronyd -F -1
             ├─systemd-resolved.service 
             │ └─379 /lib/systemd/systemd-resolved
             ├─dbus.service 
             │ └─540 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
             ├─system-getty.slice 
             │ └─getty@tty1.service 
             │   └─919 /sbin/agetty -o -p -- \u --noclear tty1 linux
             ├─google-accounts-daemon.service 
             │ └─825 /usr/bin/python3 /usr/bin/google_accounts_daemon
             └─systemd-logind.service 
               └─558 /lib/systemd/systemd-logind

and

sudo journalctl -f -u writefreely

produces…

-- Logs begin at Mon 2020-12-07 11:50:59 UTC. --
Dec 08 16:00:44 learn-podgajna systemd[1]: Started writefreely.service.
Dec 08 16:00:44 learn-podgajna systemd[24778]: writefreely.service: Changing to the requested working directory failed: No such file or directory
Dec 08 16:00:44 learn-podgajna systemd[24778]: writefreely.service: Failed at step CHDIR spawning /var/www/write.podgajna.com/writefreely: No such file or directory
Dec 08 16:00:44 learn-podgajna systemd[1]: writefreely.service: Main process exited, code=exited, status=200/CHDIR
Dec 08 16:00:44 learn-podgajna systemd[1]: writefreely.service: Failed with result 'exit-code'.
Dec 08 16:00:44 learn-podgajna systemd[1]: writefreely.service: Scheduled restart job, restart counter is at 5.
Dec 08 16:00:44 learn-podgajna systemd[1]: Stopped writefreely.service.
Dec 08 16:00:44 learn-podgajna systemd[1]: writefreely.service: Start request repeated too quickly.
Dec 08 16:00:44 learn-podgajna systemd[1]: writefreely.service: Failed with result 'exit-code'.
Dec 08 16:00:44 learn-podgajna systemd[1]: Failed to start writefreely.service.

I’m sure something is wrong with my configuration file at

/etc/systemd/system/writefreely.service:
cat /etc/systemd/system/writefreely.service

produces…

#After=syslog.target network.target
# If MySQL is running on the same machine, uncomment the following 
# line to use it, instead. 
After=syslog.target network.target mysql.service

[Service]
Type=simple
StandardOutput=syslog
StandardError=syslog
WorkingDirectory=/var/www/write.podgajna.com
ExecStart=/var/www/write.podgajna.com//writefreely
Restart=always

[Install]
WantedBy=multi-user.target

I just checked and those folders aren’t there but should they be?

I also have this in my DNS:

write.podgajna.com.	A	104.197.131.34

There might be something going on in the writefreely.service file.

I am not sure how your folder structure is, but should this:

ExecStart=/var/www/write.podgajna.com//writefreely

Be this instead?

ExecStart=/var/www/write.podgajna.com/writefreely/writefreely

That might explain the “working directory failed: No such file or directory” error. Hope that helps!

Something has gone wrong with my installation. Any chance for an interactive session with someone?

sudo systemctl status writefreely.service

produces

sudo systemctl status writefreely.service
● writefreely.service
     Loaded: loaded (/etc/systemd/system/writefreely.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2020-12-12 18:56:49 UTC; 6s ago
    Process: 100326 ExecStart=/home/podgajnaweb/writefreely/writefreely (code=exited, status=200/CHDIR)
   Main PID: 100326 (code=exited, status=200/CHDIR)

Dec 12 18:56:49 learn-podgajna systemd[1]: writefreely.service: Scheduled restart job, restart counter is at 5.
Dec 12 18:56:49 learn-podgajna systemd[1]: Stopped writefreely.service.
Dec 12 18:56:49 learn-podgajna systemd[1]: writefreely.service: Start request repeated too quickly.
Dec 12 18:56:49 learn-podgajna systemd[1]: writefreely.service: Failed with result 'exit-code'.
Dec 12 18:56:49 learn-podgajna systemd[1]: Failed to start writefreely.service.
Dec 12 18:56:56 learn-podgajna systemd[1]: /etc/systemd/system/writefreely.service:4: Assignment outside of section. Ignoring.