-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3007 from reubenmiller/feat-remote-access-socket-…
…activated feat: socket activated c8y-remote-access-plugin service
- Loading branch information
Showing
23 changed files
with
301 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
configuration/init/systemd/c8y-remote-access-plugin.socket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=c8y-remote-access-plugin socket | ||
PartOf=c8y-remote-access-plugin.service | ||
|
||
[Socket] | ||
ListenStream=/run/c8y-remote-access-plugin.sock | ||
SocketMode=0660 | ||
SocketUser=tedge | ||
SocketGroup=tedge | ||
Accept=yes | ||
|
||
[Install] | ||
WantedBy=sockets.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=c8y-remote-access-plugin Service | ||
After=network.target c8y-remote-access-plugin.socket | ||
Requires=c8y-remote-access-plugin.socket | ||
CollectMode=inactive-or-failed | ||
|
||
[Service] | ||
ExecStart=/usr/bin/c8y-remote-access-plugin --child - | ||
StandardInput=socket | ||
|
||
[Install] | ||
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,32 @@ deb: | |
depends: | ||
- tedge | ||
|
||
contents: | ||
# service definitions | ||
- src: ./configuration/init/systemd/c8y-remote-access-plugin.socket | ||
dst: /lib/systemd/system/c8y-remote-access-plugin.socket | ||
file_info: | ||
mode: 0644 | ||
packager: deb | ||
|
||
- src: ./configuration/init/systemd/c8y-remote-access-plugin.socket | ||
dst: /lib/systemd/system/c8y-remote-access-plugin.socket | ||
file_info: | ||
mode: 0644 | ||
packager: rpm | ||
|
||
- src: ./configuration/init/systemd/[email protected] | ||
dst: /lib/systemd/system/[email protected] | ||
file_info: | ||
mode: 0644 | ||
packager: deb | ||
|
||
- src: ./configuration/init/systemd/[email protected] | ||
dst: /lib/systemd/system/[email protected] | ||
file_info: | ||
mode: 0644 | ||
packager: rpm | ||
|
||
overrides: | ||
apk: | ||
scripts: | ||
|
3 changes: 3 additions & 0 deletions
3
configuration/package_scripts/_generated/c8y-remote-access-plugin/apk/postinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
|
||
|
||
|
||
### Create supported operation files | ||
c8y-remote-access-plugin --init |
1 change: 1 addition & 0 deletions
1
configuration/package_scripts/_generated/c8y-remote-access-plugin/apk/postrm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/bin/sh | ||
set -e | ||
|
2 changes: 2 additions & 0 deletions
2
configuration/package_scripts/_generated/c8y-remote-access-plugin/apk/prerm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
|
||
|
||
### Remove supported operation files | ||
c8y-remote-access-plugin --cleanup |
26 changes: 26 additions & 0 deletions
26
configuration/package_scripts/_generated/c8y-remote-access-plugin/deb/postinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Automatically added by thin-edge.io | ||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
# This will only remove masks created by d-s-h on package removal. | ||
deb-systemd-helper unmask c8y-remote-access-plugin.socket >/dev/null || true | ||
|
||
# was-enabled defaults to true, so new installations run enable. | ||
if deb-systemd-helper --quiet was-enabled c8y-remote-access-plugin.socket; then | ||
# Enables the unit on first installation, creates new | ||
# symlinks on upgrades if the unit file has changed. | ||
deb-systemd-helper enable c8y-remote-access-plugin.socket >/dev/null || true | ||
else | ||
# Update the statefile to add new symlinks (if any), which need to be | ||
# cleaned up on purge. Also remove old symlinks. | ||
deb-systemd-helper update-state c8y-remote-access-plugin.socket >/dev/null || true | ||
fi | ||
fi | ||
# End automatically added section | ||
# Automatically added by thin-edge.io | ||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
deb-systemd-invoke start c8y-remote-access-plugin.socket >/dev/null || true | ||
fi | ||
fi | ||
# End automatically added section | ||
|
||
### Create supported operation files | ||
c8y-remote-access-plugin --init |
19 changes: 19 additions & 0 deletions
19
configuration/package_scripts/_generated/c8y-remote-access-plugin/deb/postrm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
#!/bin/sh | ||
set -e | ||
# Automatically added by thin-edge.io | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
fi | ||
# End automatically added section | ||
# Automatically added by thin-edge.io | ||
if [ "$1" = "remove" ]; then | ||
if [ -x "/usr/bin/deb-systemd-helper" ]; then | ||
deb-systemd-helper mask c8y-remote-access-plugin.socket >/dev/null || true | ||
fi | ||
fi | ||
|
||
if [ "$1" = "purge" ]; then | ||
if [ -x "/usr/bin/deb-systemd-helper" ]; then | ||
deb-systemd-helper purge c8y-remote-access-plugin.socket >/dev/null || true | ||
deb-systemd-helper unmask c8y-remote-access-plugin.socket >/dev/null || true | ||
fi | ||
fi | ||
# End automatically added section |
6 changes: 6 additions & 0 deletions
6
configuration/package_scripts/_generated/c8y-remote-access-plugin/deb/prerm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Automatically added by thin-edge.io | ||
if [ -d /run/systemd/system ] && [ "$1" = remove ]; then | ||
deb-systemd-invoke stop c8y-remote-access-plugin.socket >/dev/null || true | ||
fi | ||
# End automatically added section | ||
|
||
### Remove supported operation files | ||
c8y-remote-access-plugin --cleanup |
13 changes: 13 additions & 0 deletions
13
configuration/package_scripts/_generated/c8y-remote-access-plugin/rpm/postinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Automatically added by thin-edge.io | ||
if [ $1 -eq 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then | ||
# Initial installation | ||
/usr/lib/systemd/systemd-update-helper install-system-units c8y-remote-access-plugin.socket || : | ||
fi | ||
# End automatically added section | ||
# Automatically added by thin-edge.io | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
systemctl start c8y-remote-access-plugin.socket >/dev/null || true | ||
fi | ||
# End automatically added section | ||
|
||
### Create supported operation files | ||
c8y-remote-access-plugin --init |
5 changes: 5 additions & 0 deletions
5
configuration/package_scripts/_generated/c8y-remote-access-plugin/rpm/postrm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
#!/bin/sh | ||
set -e | ||
# Automatically added by thin-edge.io | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
fi | ||
# End automatically added section |
7 changes: 7 additions & 0 deletions
7
configuration/package_scripts/_generated/c8y-remote-access-plugin/rpm/prerm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Automatically added by thin-edge.io | ||
if [ $1 -eq 0 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then | ||
# Package removal, not upgrade | ||
/usr/lib/systemd/systemd-update-helper remove-system-units c8y-remote-access-plugin.socket || : | ||
fi | ||
# End automatically added section | ||
|
||
### Remove supported operation files | ||
c8y-remote-access-plugin --cleanup |
2 changes: 2 additions & 0 deletions
2
configuration/package_scripts/c8y-remote-access-plugin/postinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
#LINUXHELPER# | ||
|
||
### Create supported operation files | ||
c8y-remote-access-plugin --init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
#LINUXHELPER# | ||
|
||
### Remove supported operation files | ||
c8y-remote-access-plugin --cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.