service
This commit is contained in:
parent
ffe88a7133
commit
9673555dd9
16
main.c
16
main.c
@ -88,7 +88,7 @@ int main(int argc,char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr,"config requires a config file as argument");
|
fprintf(stderr,"config requires a config file as argument\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -165,7 +165,7 @@ int GetSendStatus(DBusConnection *connection,char *objectpath)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr,"could not call systemdunit");
|
fprintf(stderr,"could not call systemdunit\n");
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ int gotify_message(char *url,char *title,char *message)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr,"error connecting strings for url and token");
|
fprintf(stderr,"error connecting strings for url and token\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ int systemdUnitCall(DBusConnection *connection,char *target,char *method,char *p
|
|||||||
dbus_message_iter_init_append(msg,&iter);
|
dbus_message_iter_init_append(msg,&iter);
|
||||||
if(!dbus_message_iter_append_basic(&iter,DBUS_TYPE_STRING,¶m2))
|
if(!dbus_message_iter_append_basic(&iter,DBUS_TYPE_STRING,¶m2))
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Error appending");
|
fprintf(stderr,"Error appending\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -405,7 +405,7 @@ int systemdUnitCall(DBusConnection *connection,char *target,char *method,char *p
|
|||||||
}
|
}
|
||||||
if(!dbus_message_iter_append_basic(&iter,DBUS_TYPE_STRING,¶m))
|
if(!dbus_message_iter_append_basic(&iter,DBUS_TYPE_STRING,¶m))
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Error appending");
|
fprintf(stderr,"Error appending\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -488,9 +488,3 @@ int systemdUnitCall(DBusConnection *connection,char *target,char *method,char *p
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
int checkIsActive(DBusConnection *connection, char *service_name)
|
|
||||||
{
|
|
||||||
systemdCall(connection,
|
|
||||||
}*/
|
|
||||||
|
10
systemd-gotify.service
Normal file
10
systemd-gotify.service
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Check for running systemd daemons and send notification to gotify
|
||||||
|
User=ccppi
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
WorkingDirectory=/home/ccppi/Programming/systemd-gotify/
|
||||||
|
ExecStart=/home/ccppi/Programming/systemd-gotify/a.out config config
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user