Giter Club home page Giter Club logo

circadian's Introduction

mrmekon's repos

GitHub is a mirror. The official home of my repos is here.

Repo Description Language
itsy-gitsy A static site generator for Git repositories Rust
circadian Suspend-On-Idle Daemon for GNU/Linux Power Management Rust
ossuary Rust library for establishing encrypted communication channels Rust
connectr A super lightweight Spotify controller Rust
fruitbasket Rust framework for running in a Mac "app bundle" environment Rust
rubrail Rust library for interfacing with the Mac Touch Bar Rust
tempest-cljs Tempest arcade game, in ClojureScript Clojurescript
libsimplepgp C library for loading PGP keys and decrypting PGP messages C
snitch-el Firewall for emacs elisp
qemu-stormcrow USB passthrough daemon for libvirt Rust
toucHNews Hacker News news feed for the Mac Touch Bar Rust
hn-rs Rust bindings for the Hacker News API Rust

circadian's People

Contributors

bbx0 avatar jimduchek avatar mceachen avatar mrmekon avatar quantum-byte avatar tshepang avatar vhanda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

circadian's Issues

Some warnings when compiling because of Rust changes

This isn't much of an issue but I just thought I'd mention you have some warnings because Rust's changed. I don't really know Rust, so I won't submit a pull request.

warning: trait objects without an explicit `dyn` are deprecated
  --> src/main.rs:64:32
   |
64 |     fn cause(&self) -> Option<&std::error::Error> {
   |                                ^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn std::error::Error`
   |
   = note: #[warn(bare_trait_objects)] on by default

warning: use of deprecated item 'std::sync::atomic::ATOMIC_BOOL_INIT': the `new` function is now preferred
  --> src/main.rs:43:37
   |
43 | use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
   |                                     ^^^^^^^^^^^^^^^^
   |
   = note: #[warn(deprecated)] on by default

warning: use of deprecated item 'std::sync::atomic::ATOMIC_BOOL_INIT': the `new` function is now preferred
   --> src/main.rs:235:38
    |
235 | static SIGUSR_SIGNALED: AtomicBool = ATOMIC_BOOL_INIT;
    |                                      ^^^^^^^^^^^^^^^^ help: replace the use of the deprecated item: `AtomicBool::new(false)`

`w` command default parameters

Thanks for creating this daemon, it works pretty well! :)

The current implementation relies on default parameters for the w command, which are not configured by upstream in this way. This causes issues when running on "non debian-based" distros. I run into the problem on Arch (and also created a package + patch for it https://aur.archlinux.org/packages/circadian/ )

-f, --from
Toggle printing the from (remote hostname) field. The
default as released is for the from field to not be
printed, although your system administrator or
distribution maintainer may have compiled a version in
which the from field is shown by default.

Please can you change the parameters for the w command from -hus to -husf. This does not break any existing usage and follows the upstream configuration allowing easier consumption by other distros.

Failed to start the daemon

Using Fedora Plasma 32.
Build as instructed. Change the on_idle parameter to run a script. No other changes.
sudo systemctl status circadian.service gives following

โ— circadian.service - Circadian power management service
     Loaded: loaded (/etc/systemd/system/circadian.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Tue 2020-10-27 23:14:02 CET; 19s ago
    Process: 40508 ExecStart=/usr/bin/circadian (code=exited, status=203/EXEC)
   Main PID: 40508 (code=exited, status=203/EXEC)
        CPU: 1ms

Oct 27 23:14:02 localhost.localdomain systemd[1]: circadian.service: Scheduled restart job, restart counter is at 5.
Oct 27 23:14:02 localhost.localdomain systemd[1]: Stopped Circadian power management service.
Oct 27 23:14:02 localhost.localdomain systemd[1]: circadian.service: Start request repeated too quickly.
Oct 27 23:14:02 localhost.localdomain systemd[1]: circadian.service: Failed with result 'exit-code'.
Oct 27 23:14:02 localhost.localdomain systemd[1]: Failed to start Circadian power management service.

Circadian service repeatedly fails to start - wrong executable location

I just installed Circadian in Fedora38. After following the build / installations instruction here, I found that the service status was reported as failed:

May 25 17:16:54 ian-nas.local systemd[1]: circadian.service: Start request repeated too quickly.
May 25 17:16:54 ian-nas.local systemd[1]: circadian.service: Failed with result 'exit-code'.
May 25 17:16:54 ian-nas.local systemd[1]: Failed to start circadian.service - Circadian power management service.

Looking in the syslog I found that it was in a restart loop, constantly restarting until systemd's restart time limiting kicked in. Then I noticed this in there:

May 25 17:42:07 ian-nas.local audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=circadian comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=suc>
May 25 17:42:07 ian-nas.local audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=circadian comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=succ>
May 25 17:42:07 ian-nas.local (ircadian)[1783]: circadian.service: Failed to locate executable /usr/bin/circadian: No such file or directory

The problem is that the installation instruction here say sudo cp target/release/circadian /usr/local/bin/, but circadian.service contains ExecStart=/usr/bin/circadian. I edited that latter to /usr/local/bin, and now the service is running.

Systemd service not working properly

Circadian decides that my device is idling and goes to sleep 10min (time I set) after boot. I am using Arch, herbstluftwm, X11 and I've installed all the dependencies. Circadian is running through the systemd service. What could be causing it not to detect X11 activity? Any help is greatly appreciated.

big bug

Reading config from file: /etc/circadian.conf
Circadian launching.
CircadianConfig { verbosity: 0, idle_time: 7200, auto_wake: None, on_idle: Some("systemctl suspend"), on_wake: None, tty_input: true, x11_input: true, ssh_block: true, smb_block: false, nfs_block: false, audio_block: true, max_cpu_load: Some(0.5), process_block: ["^dd$", "^rsync$", "^apt-get$", "^dpkg$", "^cp$", "^mv$"] }
Error setting auto-wake timer: Auto-wake not enabled.
Configuration valid.  Idle detection starting.
WARNING: xssstate failed for socket /tmp/.X11-unix/X0 with error: Operation not permitted (os error 1)
WARNING: xprintidle failed for socket /tmp/.X11-unix/X0 with error: Operation not permitted (os error 1)
WARNING: xssstate failed for socket /tmp/.X11-unix/X0 with error: Operation not permitted (os error 1)
WARNING: xprintidle failed for socket /tmp/.X11-unix/X0 with error: Operation not permitted (os error 1)
WARNING: xssstate failed for socket /tmp/.X11-unix/X0 with error: Operation not permitted (os error 1)
WARNING: xprintidle failed for socket /tmp/.X11-unix/X0 with error: Operation not permitted (os error 1)
WARNING: xssstate failed for socket /tmp/.X11-unix/X0 with error: Operation not permitted (os error 1)
WARNING: xprintidle failed for socket /tmp/.X11-unix/X0 with error: Operation not permitted (os error 1)

segfaults every 5 seconds

I am running Debian sid (Linux 6.7.9-amd64) and getting these errors every 5 seconds.

Apr 09 18:30:21 backups kernel: w[55548]: segfault at 4c ip 000055658bbff09e sp 00007ffe495bb270 error 4 in w[55658bbfe000+3000] likely on CPU 2 (core 2, socket 0)
Apr 09 18:30:16 backups kernel: Code: 0f be c3 48 8b 12 f6 44 42 01 40 74 7f 80 fb 20 74 7a 0f be fb 48 83 c5 01 e8 6e f1 ff ff 49 39 ee 0f 84 7d 00 00 00 45 89 e7 <0f> b6 5d 00 84 db 75 ba 45 85 ff 75 65 48 8b 35 76 3f 00 00 bf 2d
Apr 09 18:30:16 backups kernel: w[55495]: segfault at 4c ip 000055f96ea4509e sp 00007fff0e223ec0 error 4 in w[55f96ea44000+3000] likely on CPU 0 (core 0, socket 0)
Apr 09 18:30:11 backups kernel: Code: 0f be c3 48 8b 12 f6 44 42 01 40 74 7f 80 fb 20 74 7a 0f be fb 48 83 c5 01 e8 6e f1 ff ff 49 39 ee 0f 84 7d 00 00 00 45 89 e7 <0f> b6 5d 00 84 db 75 ba 45 85 ff 75 65 48 8b 35 76 3f 00 00 bf 2d
Apr 09 18:30:11 backups kernel: w[55450]: segfault at 4c ip 00005620f0d4a09e sp 00007fff067d9410 error 4 in w[5620f0d49000+3000] likely on CPU 1 (core 1, socket 0)
Apr 09 18:30:11 backups circadian[55443]: Configuration valid.  Idle detection starting.
Apr 09 18:30:11 backups circadian[55443]: Error setting auto-wake timer: Auto-wake not enabled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.