tech:jdownloader_restart
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tech:jdownloader_restart [2026/09/22 21:04] – update katsimbris | tech:jdownloader_restart [2026/09/22 21:15] (current) – [Quick Post-Update Check] katsimbris | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== Systemd Update/Restart | + | ====== JDownloader — Updates, |
| - | JDownloader's updater may temporarily exit the main Java process and launch another Java process to complete an update/ | + | JDownloader |
| - | The original systemd service used: | + | Permanent installation directory: |
| < | < | ||
| - | Type=simple | + | / |
| - | Restart=on-failure | + | |
| </ | </ | ||
| - | This worked for normal operation, but JDownloader' | + | Systemd service: |
| - | * JDownloader shutting down cleanly | + | < |
| - | * `/ | + | jdownloader.service |
| - | * the updater reporting that its self-test succeeded | + | </ |
| - | * no replacement JDownloader process successfully completing the handoff | + | |
| - | * later service starts failing with: < | + | |
| - | On September 22, 2026, a systemd override was added to better support | + | The established JDownloader configuration is stored under: |
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | ===== Normal Update Procedure ===== | ||
| + | |||
| + | It is okay to initiate a JDownloader update | ||
| + | |||
| + | JDownloader may stop and restart | ||
| + | |||
| + | After an update, verify that the service came back: | ||
| <code bash> | <code bash> | ||
| - | sudo mkdir -p /etc/ | + | systemctl is-active jdownloader |
| + | </code> | ||
| - | printf ' | + | Normal result: |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | | sudo tee / | + | |
| - | sudo systemctl daemon-reload | + | < |
| + | active | ||
| + | </ | ||
| - | Verify with: | + | For more detail: |
| <code bash> | <code bash> | ||
| - | systemctl | + | sudo systemctl |
| - | | + | |
| - | | + | |
| - | | + | |
| - | -p RemainAfterExit \ | + | |
| - | -p PIDFile | + | |
| </ | </ | ||
| - | Expected: | + | The running process can also be checked with: |
| + | |||
| + | <code bash> | ||
| + | pgrep -af ' | ||
| + | </ | ||
| + | |||
| + | A healthy installation should show Java running: | ||
| < | < | ||
| - | Type=simple | + | / |
| - | Restart=on-failure | + | |
| - | PIDFile=/ | + | |
| - | RemainAfterExit=yes | + | |
| - | KillMode=control-group | + | |
| </ | </ | ||
| - | Do **not** change `KillMode=control-group` unless there is a specific reason to do so. | + | For example: |
| - | After this change, a controlled `systemctl restart jdownloader` was tested successfully. JDownloader stopped, received a new process ID, recreated `/opt/jdownloader/JDownloader.pid`, checked for updates, and remained running with `/ | + | < |
| + | /usr/bin/java -Djava.awt.headless=true -jar / | ||
| + | </ | ||
| - | **Status:** This is the probable fix for the self-update/ | + | ===== Starting and Stopping |
| - | ==== September 21–22, 2026 Update Failure ==== | + | Start JDownloader: |
| - | On September 21, JDownloader disappeared after an update/ | + | <code bash> |
| + | sudo systemctl start jdownloader | ||
| + | </code> | ||
| - | The JAR was restored from a known-good copy and JDownloader | + | Stop JDownloader: |
| - | The same failure happened again on September 22. | + | <code bash> |
| + | sudo systemctl stop jdownloader | ||
| + | </ | ||
| - | Investigation of the second failure showed that: | + | Restart JDownloader: |
| - | * the established installation was still `/ | + | < |
| - | * JDownloader deliberately entered its update/ | + | sudo systemctl restart |
| - | * the updater launched its self-test from: < | + | </ |
| - | * the self-test completed successfully | + | |
| - | * the updater logged `Self Update successful` | + | |
| - | * the JDownloader process then shut down cleanly | + | |
| - | * `/ | + | |
| - | * no newer replacement JAR was found elsewhere under `/ | + | |
| - | Because this happened twice, | + | Check whether |
| - | The systemd configuration was then adjusted as described above to better accommodate JDownloader' | + | <code bash> |
| + | systemctl is-active jdownloader | ||
| + | </code> | ||
| - | ==== Quick Health Check ==== | + | Detailed status: |
| + | |||
| + | <code bash> | ||
| + | sudo systemctl status jdownloader --no-pager | ||
| + | </ | ||
| + | |||
| + | ===== If JDownloader Does Not Restart | ||
| + | |||
| + | First check its status: | ||
| + | |||
| + | <code bash> | ||
| + | sudo systemctl status jdownloader --no-pager | ||
| + | </ | ||
| + | |||
| + | If the service is simply stopped, try starting it: | ||
| + | |||
| + | <code bash> | ||
| + | sudo systemctl start jdownloader | ||
| + | </ | ||
| + | |||
| + | Then verify: | ||
| <code bash> | <code bash> | ||
| systemctl is-active jdownloader | systemctl is-active jdownloader | ||
| + | </ | ||
| - | ls -lh / | + | If the service fails again, **do not immediately reinstall |
| - | cat / | + | Check that the main application files still exist: |
| - | pgrep -af ' | + | <code bash> |
| + | ls -lh / | ||
| + | </ | ||
| + | |||
| + | Check whether another JDownloader Java process is already running: | ||
| + | |||
| + | <code bash> | ||
| + | pgrep -af ' | ||
| + | </ | ||
| + | |||
| + | If '' | ||
| + | |||
| + | ===== Configuration ===== | ||
| + | |||
| + | The established JDownloader configuration is stored under: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | This directory contains the settings used by the established installation. | ||
| + | |||
| + | **Preserve this directory during troubleshooting or recovery.** | ||
| + | |||
| + | Do not replace it with the configuration from a newly created or temporary JDownloader installation. | ||
| + | |||
| + | ===== .jd_home Warning ===== | ||
| + | |||
| + | During an update failure, troubleshooting, | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | Do **not** assume this is the permanent installation. | ||
| + | |||
| + | The systemd-managed installation is: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | A '' | ||
| + | |||
| + | In particular, do **not** replace: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | with: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | unless there is a specific, verified reason to do so. | ||
| + | |||
| + | The presence of newer '' | ||
| + | |||
| + | ===== Logs ===== | ||
| + | |||
| + | Show the most recent systemd log entries: | ||
| + | |||
| + | <code bash> | ||
| + | journalctl -u jdownloader -n 100 --no-pager | ||
| + | </ | ||
| + | |||
| + | Follow the service log live: | ||
| + | |||
| + | <code bash> | ||
| + | journalctl -u jdownloader -f | ||
| + | </ | ||
| + | |||
| + | Press '' | ||
| + | |||
| + | JDownloader' | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | These logs can be useful when diagnosing an update or restart failure. | ||
| + | |||
| + | ===== September 21, 2026 Update Failure ===== | ||
| + | |||
| + | On September 21, 2026, an update initiated through JDownloader resulted in the service becoming unavailable. | ||
| + | |||
| + | Investigation established that JDownloader was operating from the correct installation: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | At approximately 13:28, JDownloader deliberately initiated its normal update/ | ||
| + | |||
| + | < | ||
| + | JDownloader.jar -forceupdate | ||
| + | </ | ||
| + | |||
| + | The updater continued to operate against the correct ''/ | ||
| + | |||
| + | Its updater self-test used: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | and reported: | ||
| + | |||
| + | < | ||
| + | Validate: OK | ||
| + | SelfTest Results: OK | ||
| + | Self Update successful | ||
| + | </ | ||
| + | |||
| + | JDownloader subsequently performed a normal shutdown. At 13:31:59, systemd recorded: | ||
| + | |||
| + | < | ||
| + | jdownloader.service: | ||
| + | </ | ||
| + | |||
| + | However, by the next attempt to start the service at 13:32:55: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | was no longer available. | ||
| + | |||
| + | Systemd therefore reported: | ||
| + | |||
| + | < | ||
| + | Error: Unable to access jarfile / | ||
| + | </ | ||
| + | |||
| + | and subsequent automatic restart attempts failed for the same reason. | ||
| + | |||
| + | The exact reason the updater failed to leave a usable replacement '' | ||
| + | |||
| + | The investigation **did not find evidence that initiating the update through MyJDownloader was incorrect**, | ||
| + | |||
| + | A separate fresh JDownloader installation was discovered under: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | It contained newer application files, but its '' | ||
| + | |||
| + | The established configuration under: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | was therefore preserved. | ||
| + | |||
| + | For this specific recovery, fresh copies of '' | ||
| + | |||
| + | After recovery: | ||
| + | |||
| + | <code bash> | ||
| + | systemctl is-active jdownloader | ||
| + | </ | ||
| + | |||
| + | returned: | ||
| + | |||
| + | < | ||
| + | active | ||
| + | </ | ||
| + | |||
| + | and the running Java process again used: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | MyJDownloader also reconnected using the existing configuration. | ||
| + | |||
| + | **Important: | ||
| + | |||
| + | ===== Quick Post-Update Check ===== | ||
| + | |||
| + | After initiating a JDownloader update or restart, wait a couple of minutes and run: | ||
| + | |||
| + | <code bash> | ||
| + | systemctl is-active jdownloader | ||
| + | ls -lh / | ||
| + | cat / | ||
| + | pgrep -af ' | ||
| + | </ | ||
| Normal results should show: | Normal results should show: | ||
| - | * `active` | + | * '' |
| - | * `/ | + | * '' |
| - | * `JDownloader.pid` contains a process ID | + | * '' |
| - | * the same process ID is running Java with `/ | + | * the same process ID is running Java with '' |
| + | |||
| + | If '' | ||
| + | |||
| + | Stop the service first: | ||
| + | |||
| + | <code bash> | ||
| + | sudo systemctl stop jdownloader | ||
| + | </ | ||
| + | |||
| + | Then investigate the updater state before restoring any files. | ||
| - | If `JDownloader.jar` is missing, **do not repeatedly restart the service**. Stop JDownloader first and inspect the updater state before restoring files. | ||
tech/jdownloader_restart.1790125450.txt.gz · Last modified: by katsimbris
