1 dnl vim: set filetype=sysctl.conf.m4 syntax=sysctl.conf.m4:
2 ;-------------------------------------------------------------------------------
3 ;---- M A I N P A R T O F T H E S E R V I C E ----
4 ;-------------------------------------------------------------------------------
7 # auto generated by wgtpkg-unit for {{:id}} version {{:version}} target {{:#target}} of {{:idaver}}
11 IF_PERM(:partner:scope-platform)
12 %systemd-unit service UNIT_NAME_BASE
14 %systemd-unit service UNIT_NAME_BASE@
18 Description={{description}}
19 X-AFM-description={{description}}
20 X-AFM-name={{name.content}}
21 X-AFM-shortname={{name.short}}
23 X-AFM-version={{:version}}
24 X-AFM-author={{author.content}}
25 X-AFM-author-email={{author.email}}
27 X-AFM-height={{height}}
29 X-AFM-icon={{:#metadata.install-dir}}/{{:src}}
32 X-AFM--target-name={{:#target}}
33 X-AFM--content={{content.src}}
34 X-AFM--type={{content.type}}
35 X-AFM--wgtdir={{:#metadata.install-dir}}
36 X-AFM--workdir=APP_WORK_DIR
37 X-AFM--visibility=ON_PERM(`:public:hidden', `hidden', `visible')
40 IF_PERM(:partner:scope-platform)
42 After=afm-system-setup.service
45 Requires=afm-user-session@%i.target
49 IF_PERM(:public:display)
50 BindsTo=weston@display.service
51 After=weston@display.service
54 IF_PERM(:public:bluetooth)
55 Wants=bluetooth.target
56 After=bluetooth.target
59 IF_PERM(:public:network)
65 ConditionSecurity=smack
68 # Automatic bound to required api
71 Requires=UNIT_NAME_BINDING_SERVICE({{name}})
72 After=UNIT_NAME_BINDING_SERVICE({{name}})
78 Requires=UNIT_NAME_API_SERVICE({{name}})
79 After=UNIT_NAME_API_SERVICE({{name}})
85 Requires=UNIT_NAME_API_SOCKET({{name}})
86 After=UNIT_NAME_API_SOCKET({{name}})
94 EnvironmentFile=-@afm_confdir@/unit.env.d/*
95 EnvironmentFile=-@afm_confdir@/widget.env.d/{{:id}}/*
96 SmackProcessLabel=SMACKLABEL
97 SuccessExitStatus=0 SIGKILL
100 IF_PERM(:partner:scope-platform)
108 WorkingDirectory=-APP_WORK_DIR
109 ExecStartPre=/bin/mkdir -p APP_WORK_DIR
110 Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=USER_RUN_DIR/bus
112 IF_PERM(:system:capability:keep-all)
113 CapabilityBoundingSet=~
114 AmbientCapabilities=~
116 CapabilityBoundingSet=
119 ON_PERM(:platform:no-oom, OOMScoreAdjust=-500)
120 ON_PERM(:partner:real-time, IOSchedulingClass=realtime)
121 ON_PERM(:public:display, SupplementaryGroups=display)
122 ON_PERM(:public:audio, SupplementaryGroups=audio)
123 ON_NOT_PERM(:public:syscall:clock, SystemCallFilter=~@clock)
126 Environment=AFM_ID=TARGET
127 Environment=AFM_APP_INSTALL_DIR={{:#metadata.install-dir}}
128 Environment=AFM_WORKDIR=APP_WORK_DIR
129 Environment=AFM_WSAPI_DIR=API_PATH_WS
130 Environment=PATH=/usr/sbin:/usr/bin:/sbin:/bin:{{:#metadata.install-dir}}/bin
131 Environment=LD_LIBRARY_PATH={{:#metadata.install-dir}}/lib
132 Environment=XDG_DATA_HOME=APP_WORK_DIR
133 Environment=XDG_CONFIG_HOME=APP_WORK_DIR
134 Environment=XDG_CACHE_HOME=APP_WORK_DIR
135 Environment=XDG_RUNTIME_DIR=RUN_DIR
136 ON_CONTENT(text/html, Environment=WAIT_FOR_HOST_SERVICE="1")
139 ; Needed to enable debug
140 EnvironmentFile=-DEBUGGING_DIR/TARGET.env
143 SyslogIdentifier=afbd-TARGET
145 StandardOutput=journal
146 StandardError=journal
148 ;-------------------------------------------------------------------------------
149 ;---- text/html application/vnd.agl.native application/vnd.agl.service ----
150 ;-------------------------------------------------------------------------------
151 {{#content.type=text/html|application/vnd.agl.native|application/vnd.agl.service}}
153 {{/content.type=text/html|application/vnd.agl.native|application/vnd.agl.service}}
155 ;-------------------------------------------------------------------------------
156 ;---- application/x-executable ----
157 ;-------------------------------------------------------------------------------
158 {{#content.type=application/x-executable}}
159 ExecStart={{:#metadata.install-dir}}/{{content.src}}
160 {{/content.type=application/x-executable}}
162 ;-------------------------------------------------------------------------------
163 ;---- application/vnd.agl.resource ----
164 ;-------------------------------------------------------------------------------
165 {{#content.type=application/vnd.agl.resource}}
168 {{/content.type=application/vnd.agl.resource}}
170 IF_PERM(:system:run-by-default)
171 ;-------------------------------------------------------------------------------
173 ;-------------------------------------------------------------------------------
175 IF_PERM(:partner:scope-platform)
176 WantedBy=multi-user.target
177 %systemd-unit wanted-by multi-user.target
179 WantedBy=afm-user-session@.target
180 %systemd-unit wanted-by afm-user-session@.target