Skip to content

Commit

Permalink
creating runtime directory /run/tedge_agent (#683) (#698)
Browse files Browse the repository at this point in the history
* creating runtime directory /run/tedge_agent (#683)

Signed-off-by: initard <[email protected]>

* ignoring test due to permission error (#683)

Signed-off-by: initard <[email protected]>

Co-authored-by: initard <[email protected]>
  • Loading branch information
initard and initard authored Dec 9, 2021
1 parent 07faba9 commit 846c1dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions configuration/init/systemd/tedge-agent.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Requires=tedge-mapper-sm-c8y.service

[Service]
User=tedge-agent
RuntimeDirectory=tedge_agent
ExecStart=/usr/bin/tedge_agent
Restart=on-failure
RestartPreventExitStatus=255
Expand Down
2 changes: 1 addition & 1 deletion crates/core/tedge_agent/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ async fn publish_capabilities(mqtt: &Client) -> Result<(), AgentError> {
#[cfg(test)]
mod tests {
use super::*;
const SLASH_RUN_PATH_TEDGE_AGENT_RESTART: &str = "/run/tedge_agent_restart";
const SLASH_RUN_PATH_TEDGE_AGENT_RESTART: &str = "/run/tedge_agent/tedge_agent_restart";

#[ignore]
#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion crates/core/tedge_agent/src/restart_operation_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod restart_operation {
use std::{fs::File, fs::OpenOptions, io::Read, io::Write, path::Path};
use time::OffsetDateTime;

const SLASH_RUN_PATH_TEDGE_AGENT_RESTART: &str = "/run/tedge_agent_restart";
const SLASH_RUN_PATH_TEDGE_AGENT_RESTART: &str = "/run/tedge_agent/tedge_agent_restart";
const SLASH_PROC_UPTIME: &str = "/proc/uptime";

/// creates an empty file in /run
Expand Down

0 comments on commit 846c1dc

Please sign in to comment.