Skip to content

Commit 23acba6

Browse files
authored
Merge pull request #115 from EmixamPP/systemd
Fix systemd hanging in some case
2 parents ce3bfc3 + ab589dc commit 23acba6

5 files changed

Lines changed: 23 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
id: setup
2727
run: |
2828
meson setup build --pkg-config-path opencv-4.7.0/lib64/pkgconfig
29+
meson configure build -Dlibdir=lib64
2930
3031
- name: Compile
3132
run: |

.github/workflows/pr-comment.yml

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,28 @@ jobs:
2020
OWNER: ${{ github.repository_owner }}
2121
REPO: ${{ github.event.repository.name }}
2222
run: |
23-
PREVIOUS_JOB_ID=$(jq -r '.id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
24-
echo "Previous Job ID: $PREVIOUS_JOB_ID"
25-
echo "PREVIOUS_JOB_ID=$PREVIOUS_JOB_ID" >> "$GITHUB_ENV"
23+
PR_NUMBER=$(jq -r '.pull_requests[0].number' <<< "$WORKFLOW_RUN_EVENT_OBJ")
24+
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
2625
26+
HEAD_SHA=$(jq -r '.pull_requests[0].head.sha' <<< "$WORKFLOW_RUN_EVENT_OBJ")
27+
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_ENV"
28+
2729
SUITE_ID=$(jq -r '.check_suite_id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
28-
echo "Previous Suite ID: $SUITE_ID"
2930
echo "SUITE_ID=$SUITE_ID" >> "$GITHUB_ENV"
30-
31-
ARTIFACT_ID=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
31+
32+
PREVIOUS_JOB_ID=$(jq -r '.id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
33+
echo "PREVIOUS_JOB_ID=$PREVIOUS_JOB_ID" >> "$GITHUB_ENV"
34+
35+
ARTIFACT=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
3236
--jq ".artifacts.[] |
3337
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
34-
select(.expired==false) |
35-
.id")
36-
37-
echo "Artifact ID: $ARTIFACT_ID"
38+
select(.expired==false)")
39+
40+
ARTIFACT_ID=$(jq -r '.id' <<< ${ARTIFACT})
3841
echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_ENV"
3942
40-
ARTIFACT_EXPIRE_DATE=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
41-
--jq ".artifacts.[] |
42-
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
43-
select(.expired==false) |
44-
.expires_at")
45-
46-
echo "Artifact Expire Date: $ARTIFACT_EXPIRE_DATE"
43+
ARTIFACT_EXPIRE_DATE=$(jq -r '.expires_at' <<< ${ARTIFACT})
4744
echo "ARTIFACT_EXPIRE_DATE=$ARTIFACT_EXPIRE_DATE" >> "$GITHUB_ENV"
48-
49-
PR_NUMBER=$(jq -r '.pull_requests[0].number' \
50-
<<< "$WORKFLOW_RUN_EVENT_OBJ")
51-
52-
echo "Pull request Number: $PR_NUMBER"
53-
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
54-
55-
HEAD_SHA=$(jq -r '.pull_requests[0].head.sha' \
56-
<<< "$WORKFLOW_RUN_EVENT_OBJ")
57-
58-
echo "Head SHA: $HEAD_SHA"
59-
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_ENV"
6045
6146
- name: Find comment
6247
uses: peter-evans/find-comment@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ It can be uninstalled by executing:
1818
```
1919
sudo rm -rf /usr/lib64/linux-enable-ir-emitter \
2020
/etc/linux-enable-ir-emitter \
21-
/usr/bin/liblinux-enable-ir-emitter \
21+
/usr/libexec/linux-enable-ir-emitter \
2222
/usr/bin/linux-enable-ir-emitter \
2323
/usr/lib/systemd/system/linux-enable-ir-emitter.service \
2424
/etc/udev/rules.d/99-linux-enable-ir-emitter.rules \

meson.build

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ opencv_dep = dependency('opencv4', static: true)
1616
################
1717
# Lib executable
1818
################
19-
lib_bin_dir = get_option('bindir') / 'lib' + meson.project_name()
19+
lib_exec_dir = get_option('libexecdir') / meson.project_name()
2020

2121
executable(
2222
'driver-generator',
@@ -27,7 +27,7 @@ executable(
2727
'sources/driver/finder.cpp',
2828
dependencies: opencv_dep,
2929
install: true,
30-
install_dir: lib_bin_dir,
30+
install_dir: lib_exec_dir,
3131
)
3232

3333
executable(
@@ -38,7 +38,7 @@ executable(
3838
'sources/driver/driver.cpp',
3939
dependencies: opencv_dep,
4040
install: true,
41-
install_dir: lib_bin_dir,
41+
install_dir: lib_exec_dir,
4242
)
4343

4444
#####
@@ -60,8 +60,8 @@ boot_service = get_option('boot_service')
6060

6161
configure_paths_data = configuration_data({
6262
'SAVE_DRIVER_FOLDER_PATH': get_option('sysconfdir') / meson.project_name(),
63-
'BIN_EXECUTE_DRIVER_PATH': '/usr' / lib_bin_dir / 'execute-driver',
64-
'BIN_DRIVER_GENERATOR_PATH': '/usr' / lib_bin_dir / 'driver-generator',
63+
'BIN_EXECUTE_DRIVER_PATH': '/usr' / lib_exec_dir / 'execute-driver',
64+
'BIN_DRIVER_GENERATOR_PATH': '/usr' / lib_exec_dir / 'driver-generator',
6565
'UDEV_RULE_PATH': '/etc/udev/rules.d/99-linux-enable-ir-emitter.rules',
6666
'BOOT_SERVICE_MANAGER': boot_service,
6767
})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[Unit]
22
Description = enable the infrared emitter
3-
After = multi-user.target suspend.target hybrid-sleep.target hibernate.target suspend-then-hibernate.target
3+
After = suspend.target sleep.target hybrid-sleep.target hibernate.target suspend-then-hibernate.target
44

55
[Service]
66
Type = oneshot
77
ExecStartPre = /sbin/modprobe uvcvideo
88
ExecStart = /usr/bin/linux-enable-ir-emitter run
99

1010
[Install]
11-
WantedBy = multi-user.target suspend.target hybrid-sleep.target hibernate.target suspend-then-hibernate.target
11+
WantedBy = multi-user.target suspend.target sleep.target hybrid-sleep.target hibernate.target suspend-then-hibernate.target

0 commit comments

Comments
 (0)