Skip to main content

Service

The behaviors that service calls, and each call that its examples make. osapi behavior chain get --name service shows the same.

Chain​

Behaviorservice
Chainservice → (object, managedfile)
Callsobject, managedfile
Used bynone

Deploy a unit file (create)​

CALLSENDSGETS
service createname=app object=app.servicechanged=true name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.serviceerror: /etc/systemd/system/osapi-app.service: not managed
└─ object getname=app.servicecontent=<8 lines> content_type=raw name=app.service sha256=f1f13ddd26…
└─ managedfile updatecontent=<8 lines> metadata={"object":"app.service"} mode=0644 path=/e…changed=true path=/etc/systemd/system/osapi-app.service

A unit file that has the content (create)​

CALLSENDSGETS
service createname=app object=app.servicechanged=false name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.servicemetadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.…
└─ object getname=app.servicecontent=<8 lines> content_type=raw name=app.service sha256=f1f13ddd26…
└─ managedfile updatecontent=<8 lines> metadata={"object":"app.service"} mode=0644 path=/e…changed=false path=/etc/systemd/system/osapi-app.service

A new unit file (update)​

CALLSENDSGETS
service updatename=app object=app-v2.servicechanged=true name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.servicemetadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.…
└─ object getname=app-v2.servicecontent=<9 lines> content_type=raw name=app-v2.service sha256=a67ff5f…
└─ managedfile updatecontent=<9 lines> metadata={"object":"app-v2.service"} mode=0644 path…changed=true path=/etc/systemd/system/osapi-app.service

Remove a service (delete)​

CALLSENDSGETS
service deletename=appchanged=true name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.servicemetadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.…
└─ managedfile deletepath=/etc/systemd/system/osapi-app.servicechanged=true path=/etc/systemd/system/osapi-app.service

A service that osapi did not deploy (delete)​

CALLSENDSGETS
service deletename=appchanged=false name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.serviceerror: /etc/systemd/system/osapi-app.service: not managed

A unit file that osapi did not deploy (delete)​

CALLSENDSGETS
service deletename=agentchanged=false name=agent
└─ managedfile getpath=/etc/systemd/system/osapi-agent.serviceerror: /etc/systemd/system/osapi-agent.service: not managed

Start the service (start)​

CALLSENDSGETS
service startname=appchanged=true name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.servicemetadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.…

Stop the service (stop)​

CALLSENDSGETS
service stopname=appchanged=true name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.servicemetadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.…

Restart the service (restart)​

CALLSENDSGETS
service restartname=appchanged=true name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.servicemetadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.…

Enable the service (enable)​

CALLSENDSGETS
service enablename=appchanged=true name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.servicemetadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.…

A unit with no [Install] section (enable)​

CALLSENDSGETS
service enablename=staticchanged=false name=static
└─ managedfile getpath=/etc/systemd/system/osapi-static.servicemetadata={"object":"static.service"} path=/etc/systemd/system/osapi-s…

Disable the service (disable)​

CALLSENDSGETS
service disablename=appchanged=true name=app
└─ managedfile getpath=/etc/systemd/system/osapi-app.servicemetadata={"object":"app.service"} path=/etc/systemd/system/osapi-app.…