Installation is processed as root (sudoer) and consequently enabling
"manually" (by creating link) xds-agent service during install is not
a good idea. The only viable solution is to well document how user
should enable it as a user systemd service, IOW:
systemctl --user enable xds-agent.service
Change-Id: Iba1f3bb501c099606b53d6cf39239af499787aa7
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
mkdir -p $(DEB_BASE_DIR)/etc/default $(DEB_BASE_DIR)/etc/xds/agent
cp $(DEB_INSTALL_XDS_DIR)/conf.d/etc/default/xds-agent $(DEB_BASE_DIR)/etc/default/
cp $(DEB_INSTALL_XDS_DIR)/conf.d/etc/xds/agent/* $(DEB_BASE_DIR)/etc/xds/agent/
mkdir -p $(DEB_BASE_DIR)/etc/default $(DEB_BASE_DIR)/etc/xds/agent
cp $(DEB_INSTALL_XDS_DIR)/conf.d/etc/default/xds-agent $(DEB_BASE_DIR)/etc/default/
cp $(DEB_INSTALL_XDS_DIR)/conf.d/etc/xds/agent/* $(DEB_BASE_DIR)/etc/xds/agent/
- mkdir -p $(DEB_BASE_DIR)/etc/systemd/user/multi-user.target.wants
- ln -s /usr/lib/systemd/user/xds-agent.service $(DEB_BASE_DIR)/etc/systemd/user/multi-user.target.wants/
# Add XDS in user's PATH
mkdir -p $(DEB_BASE_DIR)/etc/profile.d
# Add XDS in user's PATH
mkdir -p $(DEB_BASE_DIR)/etc/profile.d
mkdir -p %{?buildroot}/%{_sysconfdir}/xds/agent
cp ./conf.d/etc/xds/agent/* %{?buildroot}/%{_sysconfdir}/xds/agent/
mkdir -p %{?buildroot}/%{_sysconfdir}/xds/agent
cp ./conf.d/etc/xds/agent/* %{?buildroot}/%{_sysconfdir}/xds/agent/
-mkdir -p %{?buildroot}%{_userunitdir}/default.target.wants && ln -s ../xds-agent.service %{?buildroot}%{_userunitdir}/default.target.wants/
-
mkdir -p %{?buildroot}%{_sysconfdir}/profile.d
sed -e "s;@XDS_INSTALL_BIN_DIR@;%{_bindir};g" ./conf.d/etc/profile.d/xds-agent.sh > %{buildroot}%{_sysconfdir}/profile.d/%{name}.sh
mkdir -p %{?buildroot}%{_sysconfdir}/profile.d
sed -e "s;@XDS_INSTALL_BIN_DIR@;%{_bindir};g" ./conf.d/etc/profile.d/xds-agent.sh > %{buildroot}%{_sysconfdir}/profile.d/%{name}.sh
%config %{_sysconfdir}/profile.d/%{name}.sh
%dir %{_userunitdir}
%{_userunitdir}/xds-agent.service
%config %{_sysconfdir}/profile.d/%{name}.sh
%dir %{_userunitdir}
%{_userunitdir}/xds-agent.service
-%dir %{_userunitdir}/default.target.wants
-%{_userunitdir}/default.target.wants/xds-agent.service
%post
if [ "$1" -ge 2 ]; then
%post
if [ "$1" -ge 2 ]; then