1. 15 Sep, 2025 14 commits
    • nextime's avatar
      Fix bash condition evaluation in init scripts · 24611f90
      nextime authored
      - Separate PID file reading from process checking
      - Prevent command substitution failures in kill command
      - Add proper error handling for PID file operations
      - Fix false 'watchdog failed' reports due to bash syntax issues
      - Fixed both wssshd and wssshc init scripts
      24611f90
    • nextime's avatar
      Add debug logging to watchdog monitoring loops · a15aa00d
      nextime authored
      - Add detailed logging to main() monitoring loops
      - Track loop iterations and daemon status checks
      - Log sleep intervals and monitoring status
      - Help diagnose why watchdog exits prematurely
      - Fixed both wssshd and wssshc watchdogs
      a15aa00d
    • nextime's avatar
      Fix init scripts to handle existing watchdog processes · 299eed2b
      nextime authored
      - Stop existing watchdog before starting new one
      - Use pgrep to detect running watchdog processes
      - Prevent 'watchdog already running' conflicts
      - Ensure clean watchdog startup in init scripts
      - Fixed both wssshd and wssshc init scripts
      299eed2b
    • nextime's avatar
      Fix duplicate check_restart_limits() functions in watchdogs · 844a88ba
      nextime authored
      - Removed duplicate function definitions causing bash arithmetic errors
      - Kept the more complete check_restart_limits() function with awk timestamp parsing
      - Fixed both wssshd and wssshc watchdog scripts
      - Eliminates 'integer expression expected' errors
      844a88ba
    • nextime's avatar
      Refactor init scripts to start daemons directly before watchdog · 7c51589c
      nextime authored
      - Init scripts now start wssshd/wssshc daemons directly
      - Wait for daemons to be fully running before starting watchdog
      - Watchdog only monitors existing daemons, doesn't start them
      - Watchdog exits if daemon restart fails
      - Proper startup sequence: daemon → verify running → watchdog
      - Fixed both wssshd and wssshc init scripts and watchdogs
      7c51589c
    • nextime's avatar
      Add startup delay for daemon initialization · fa858590
      nextime authored
      - Watchdog now waits 3 seconds after starting daemon before checking status
      - Prevents false detection of daemon failure during startup
      - Gives daemon time to fully initialize and create PID file
      - Fixed both wssshd and wssshc watchdogs
      - Improves reliability of daemon startup detection
      fa858590
    • nextime's avatar
      Fix watchdog daemonization with setsid · 309d1940
      nextime authored
      - Use setsid to properly daemonize main() function
      - setsid bash -c 'main' & creates independent process group
      - Prevents main() from being killed when parent script exits
      - Fixed both wssshd and wssshc watchdogs
      - Watchdog processes should now persist correctly
      309d1940
    • nextime's avatar
      Fix watchdog daemonization issue · cab9eefd
      nextime authored
      - Watchdog now properly daemonizes by running main() in background
      - Removed complex PID file waiting logic that was causing issues
      - Simplified start case to just run main() and check for PID file
      - Fixed both wssshd and wssshc watchdogs
      - Watchdog processes should now persist after script exits
      cab9eefd
    • nextime's avatar
      Fix init scripts to kill processes even without PID file · 81f5c328
      nextime authored
      - Stop functions now kill daemon processes regardless of PID file existence
      - Added fallback pkill mechanism for processes without PID files
      - Uses graceful TERM signal followed by force KILL signal
      - Fixed both wssshd and wssshc init scripts
      - Ensures complete process cleanup in all scenarios
      81f5c328
    • nextime's avatar
      Fix init scripts to stop daemons directly when watchdog not running · 9c51519e
      nextime authored
      - Init scripts now stop daemons directly even if watchdog PID file doesn't exist
      - Added graceful termination (TERM) followed by force kill (KILL) if needed
      - Added pkill fallback to catch any remaining daemon processes
      - Fixed both wssshd and wssshc init scripts
      - Ensures complete daemon shutdown regardless of watchdog status
      9c51519e
    • nextime's avatar
      Fix watchdog stop command to kill all running processes · f8f89d64
      nextime authored
      - Stop command now kills processes from PID file AND any other running watchdog processes
      - Prevents zombie watchdog processes when PID file doesn't exist
      - Added aggressive cleanup of all watchdog processes
      - Fixed both wssshd and wssshc watchdogs
      - Ensures complete watchdog shutdown even with startup failures
      f8f89d64
    • nextime's avatar
      Add debug logging to watchdog scripts · 1c1a2538
      nextime authored
      - Log START configuration values and validation
      - Add detailed startup debugging in start case
      - Track main() function PID and PID file creation
      - Help identify why watchdog fails to start properly
      - Applied to both wssshd and wssshc watchdogs
      1c1a2538
    • nextime's avatar
      Fix all bash syntax errors: remove 'local' keyword from script body · 646ff942
      nextime authored
      - Removed 'local' from stop and status case handlers in both watchdogs
      - 'local' can only be used inside functions, not in main script body
      - Fixed both wssshd-watchdog and wssshc-watchdog scripts
      - All bash syntax errors should now be resolved
      646ff942
    • nextime's avatar
      Fix bash syntax error: remove 'local' keyword from script body · dea963e9
      nextime authored
      - 'local' can only be used inside functions, not in main script body
      - Fixed both wssshd-watchdog and wssshc-watchdog scripts
      - Removed 'local count=0' from start case handlers
      dea963e9
  2. 14 Sep, 2025 22 commits
    • nextime's avatar
      Restore proper watchdog continuous monitoring behavior · 9932ff92
      nextime authored
      - Watchdogs now run in infinite loop monitoring daemons every 30 seconds
      - Check START=yes configuration before starting monitoring
      - Restart daemons if they die, with max 20 restarts per minute limit
      - Double-check processes are actually running and correct
      - Fixed both wssshd and wssshc watchdogs to run continuously
      - Removed one-time start logic, restored continuous monitoring
      9932ff92
    • nextime's avatar
      Fix wssshd user permission issue for home directory · 4282f289
      nextime authored
      - Add permission verification in postinst scripts for both wssshd and wssshc
      - Test if users can write to their home directories
      - Fix permissions if write access is denied (chmod 775)
      - Ensure users are in correct groups
      - Prevent 'Permission denied' errors when creating .config directories
      4282f289
    • nextime's avatar
      Complete watchdog fix with restart limiting · 3a5568d4
      nextime authored
      - Implement one-time start logic (no continuous monitoring)
      - Add restart limiting: max 20 restarts per minute
      - Watchdog exits after successful start or if limits exceeded
      - Double-check processes are actually running and correct
      - Clean up PID files properly on exit
      - Fixed both wssshd and wssshc watchdogs
      3a5568d4
    • nextime's avatar
      Fix watchdog behavior to prevent unnecessary restarts · 153db18a
      nextime authored
      - Change watchdogs from continuous monitoring to one-time start
      - Check START=yes in /etc/default/ before starting services
      - Only start services if they're not already running
      - Double-check processes are actually running and correct
      - Improve status and stop functions with process verification
      - Fix both wssshd and wssshc watchdogs
      153db18a
    • nextime's avatar
      Fix watchdog PID file race condition · e348dd54
      nextime authored
      - Watchdog scripts now wait for PID file creation before exiting
      - Reduced init script sleep time from 3 to 1 second
      - Prevents 'Watchdog failed to start properly' timing issues
      - Fixed both wssshd and wssshc watchdog/init scripts
      e348dd54
    • nextime's avatar
      Fix --debian-only to build only wsssh-tools package · 50a1e7af
      nextime authored
      - --debian-only now builds only wsssh-tools, not wsssh-server
      - Updated help text to clarify --debian-only behavior
      - Updated output messages for --debian-only vs --packages
      50a1e7af
    • nextime's avatar
      d2d3fc32
    • nextime's avatar
      Update clean.sh to remove wsssh-server Debian packages · e7c202a8
      nextime authored
      - Add cleanup for wsssh-server*.deb packages and artifacts
      - Add cleanup for wsssh-server debian build directory
      - Ensure both wsssh-server and wsssh-tools packages are cleaned
      e7c202a8
    • nextime's avatar
      Add systemd startup files to Debian packages · 9b90a3c6
      nextime authored
      - Create systemd service files for wssshd and wssshc
      - Add conditions to prevent conflicts with sysv init
      - Update debian/rules to install systemd services
      - Update postinst scripts to enable systemd services
      - Ensure sysv init has precedence over systemd
      9b90a3c6
    • nextime's avatar
      Fix watchdog START configuration handling · 8faacbfb
      nextime authored
      - Remove set -x tracing from init and watchdog scripts
      - Fix wssshd and wssshc watchdogs to accept various START values
      - Support yes, YES, Y, 1, true, TRUE as documented in config files
      8faacbfb
    • nextime's avatar
      Add proper log rotation support to Debian packages · c476d907
      nextime authored
      - Created logrotate configuration files for both wssshd and wssshc
      - wssshd.logrotate: Rotates /var/log/wssshd/watchdog.log weekly
      - wssshc.logrotate: Rotates /var/log/wssshc/watchdog.log weekly
      - Both configs include postrotate scripts to HUP watchdog processes
      - Install logrotate configs to /etc/logrotate.d/ in both packages
      - Added /etc/logrotate.d directory creation to debian/rules
      - Log rotation settings: weekly, 52 rotations, compress, proper permissions
      - Ensures logs don't grow indefinitely and consume disk space
      - Follows Debian packaging standards for log management
      - Automatic log rotation prevents production system issues
      c476d907
    • nextime's avatar
      Improve watchdog scripts robustness and error handling · 19a0ac29
      nextime authored
      - Added fallback mechanism when start-stop-daemon fails
      - Try direct daemon execution if start-stop-daemon fails
      - Added better error checking for daemon binary existence
      - Simplified complex awk-based restart limit checking
      - Added proper error suppression for directory operations
      - Made watchdog scripts more robust for testing/development environments
      - Disabled restart limiting temporarily to avoid parsing issues
      - Improved logging for troubleshooting startup failures
      - Both wssshd-watchdog and wssshc-watchdog updated with same improvements
      19a0ac29
    • nextime's avatar
      Fix wsssh-server Debian package build - missing /usr/sbin directory · c3479481
      nextime authored
      - Added mkdir command to create /usr/sbin directory in wsssh-server debian/rules
      - Fixed 'No such file or directory' error when installing wssshd-watchdog
      - Ensures proper directory structure for watchdog script installation
      - Resolves build failure when running build.sh --packages or --debian-only
      - Maintains consistency with other directory creation commands
      c3479481
    • nextime's avatar
      Fix wssshtools Debian package build - missing /usr/sbin directory · 28618aa1
      nextime authored
      - Added mkdir command to create /usr/sbin directory in debian/rules
      - Fixed 'No such file or directory' error when installing wssshc-watchdog
      - Ensures proper directory structure for watchdog script installation
      - Resolves build failure when running build.sh --packages or --debian-only
      - Maintains consistency with other directory creation commands
      28618aa1
    • nextime's avatar
      Add --packages option to build.sh script · 79489824
      nextime authored
      - Added new --packages option that builds all Debian packages
      - Equivalent to running --debian-only (builds both wsssh-server and wsssh-tools packages)
      - Updated help text and usage information
      - Updated final output message to handle --packages option
      - Provides convenient way to build all packages in one command
      - Maintains backward compatibility with existing options
      79489824
    • nextime's avatar
      Fix Debian init scripts and watchdog installation issues · 79e67da7
      nextime authored
      - Fixed wssshd.init and wssshc.init to work on Debian/Ubuntu systems
      - Changed function library from Red Hat (/etc/rc.d/init.d/functions) to Debian (/lib/lsb/init-functions)
      - Replaced Red Hat echo_success/echo_failure functions with simple echo statements
      - Added watchdog script installation to both wsssh-server and wssshtools debian/rules
      - wssshd-watchdog now installs to /usr/sbin/wssshd-watchdog
      - wssshc-watchdog now installs to /usr/sbin/wssshc-watchdog
      - Fixed init script compatibility issues that were causing 'command not found' errors
      - Ensured proper service management on Debian-based systems
      - Resolved missing watchdog script errors during service startup
      79e67da7
    • nextime's avatar
      Fix wssshtools Debian package build - missing directory creation · 14a4a0a3
      nextime authored
      - Added mkdir commands to create necessary directories before install
      - Fixed 'No such file or directory' error in debian/rules
      - Created directories: /etc/init.d, /usr/share/wsssh, /etc/default, /usr/bin
      - Ensures proper directory structure for package installation
      - Resolves build failure when running build.sh --debian-only
      - Maintains compatibility with existing build process
      14a4a0a3
    • nextime's avatar
      Add support for non-interactive wsssh-server package installations · d23b4438
      nextime authored
      - Modified debconf template to include note about non-interactive handling
      - Updated preinst script to detect DEBIAN_FRONTEND=noninteractive
      - Automatically stops service in non-interactive environments without prompting
      - Changed debconf priority from 'high' to 'medium' for better UX
      - Added fallback handling for when debconf fails or returns empty values
      - Updated README.md with instructions for non-interactive installations
      - Ensures compatibility with automated deployment scripts and CI/CD pipelines
      - Maintains user control in interactive environments while enabling automation
      d23b4438
    • nextime's avatar
      Fix PyInstaller binary upgrade handling for wsssh-server package · 0401fb37
      nextime authored
      - Created preinst script to stop wssshd service before upgrade
      - Modified postinst script to restart service if it was running before upgrade
      - Added proper state tracking using /tmp/wsssh-server-upgrade-state file
      - Ensures zero-downtime upgrades by handling PyInstaller binary file locks
      - Updated README.md to document the automatic upgrade handling
      - Prevents 'file in use' errors during package upgrades
      - Maintains service continuity across upgrades
      0401fb37
    • nextime's avatar
      Update repository URLs and version to 1.4.3 · 96632028
      nextime authored
      - Updated version to 1.4.3 in CHANGELOG.md
      - Changed all repository URLs from GitHub to git.nexlab.net/nexlab/wsssh
      - Updated debian/control files for both wsssh-server and wssshtools packages
      - Updated debian/changelog files with version 1.4.3 entries
      - Updated all man pages (wsssh.1, wssshc.1, wsscp.1, wssshd.1) with new repository URL
      - Updated README.md and DOCUMENTATION.md with correct repository URLs
      - Fixed all references to point to the correct NexLab Git repository
      - Maintained consistency across all documentation and packaging files
      96632028
    • nextime's avatar
      Update documentation to reflect standalone wsssh-server package · aab309c2
      nextime authored
      - Updated README.md to clarify that wsssh-server package requires no Python dependencies
      - Added note about PyInstaller standalone binary in installation instructions
      - Updated DOCUMENTATION.md to reflect minimal dependencies (only adduser)
      - Clarified that Python dependencies are bundled in the PyInstaller binary
      - Improved package description to emphasize standalone nature
      aab309c2
    • nextime's avatar
      Fix wsssh-server Debian package dependencies · e2e4c4ec
      nextime authored
      - Removed unnecessary Python package dependencies from debian/control
      - Since wsssh-server uses PyInstaller standalone binary, it doesn't need:
        - python3-websockets
        - python3-flask
        - python3-flask-login
        - python3-flask-sqlalchemy
        - python3-pty
        - python3 (base Python is still needed for the binary to run)
      - Kept only essential dependency: adduser (for user creation)
      - Updated package description to clarify it's a standalone binary
      - This resolves dpkg dependency issues when installing on remote machines
      e2e4c4ec
  3. 13 Sep, 2025 4 commits
    • nextime's avatar
      Update TODO.md with completed tasks for version 1.4.2 · 0dbb40fa
      nextime authored
      - Added 'Recently Completed' section documenting all v1.4.2 improvements
      - Marked ping frame parsing fix as completed
      - Marked WebSocket reconnection logic as completed
      - Marked professional watchdog scripts as completed
      - Marked enhanced init scripts as completed
      - Marked build system fixes as completed
      - Marked Debian package improvements as completed
      - Marked binary reuse logic as completed
      - Marked documentation updates as completed
      0dbb40fa
    • nextime's avatar
      Add debian package · 47cea202
      nextime authored
      47cea202
    • nextime's avatar
      Update documentation for version 1.4.2 build system fixes · b9fd9942
      nextime authored
      - Updated CHANGELOG.md with comprehensive build system fixes documentation
      - Updated README.md with version 1.4.2 changelog information
      - Updated DOCUMENTATION.md with build system improvements
      - Documented all Debian package build fixes and enhancements
      - Added details about binary reuse, error handling, and build efficiency improvements
      b9fd9942
    • nextime's avatar
      Fix debian/rules directory creation for install target · e75b2eda
      nextime authored
      - Added mkdir -p commands to create all necessary directories before install
      - Ensures debian/wsssh-server/usr/bin/ and other directories exist
      - Fixes 'No such file or directory' error during package installation
      - Resolves issue when installing files into non-existent directory structure
      - Makes the debian package build process more robust
      e75b2eda