Ken Moore
67e687ba4c
Update the sysadm/update API class:
...
Make it able to use "trueos-update" as well as "pc-updatemanager" for upgrades
2018-09-01 07:33:26 -04:00
Ken Moore
fd5504b304
Allow the "CDN_TYPE" option to be exposed via the update settings API calls now.
...
This allows an easy way to switch between IPFS and CDN types.
2018-02-05 09:58:46 -05:00
Ken Moore
6b43bc6a29
Couple quick updates for handling failed update checks.
2017-12-07 09:39:18 -05:00
Ken Moore
77986e0312
Fix the update-required flag detection
2017-11-22 10:43:00 -05:00
Ken Moore
c5bf944017
[API CHANGE] Add a new API call for sysadm/update: action="applyupdate".
...
This takes no other inputs, and returns the following:
{
"applyupdate" : {
"result" : "rebooting to apply updates"
}
}
2017-11-17 15:58:37 -05:00
Ken Moore
ce53715265
Make sure the system update check is done via a DISPATCHER process.
...
This prevent possible hangs in the main server thread from the health check, and also ensures that the system update check API call can now return a new "checkingforupdates" status.
2017-10-27 13:35:42 -04:00
Ken Moore
e9a338fa0f
Make sure that pc-updatemanager syncconf is always run before any automated update checks begin.
2017-08-25 09:25:18 -04:00
Ken Moore
57e197669e
Make sure we clean up any extra empty lines in the update check.
2017-01-23 15:16:32 -05:00
Ken Moore
efb78c9627
Make sure the updatesAvailable flag does not get saved if there was a network error during the check,
2017-01-17 09:49:26 -05:00
Ken Moore
311bd579f3
API CHANGE:
...
Two new actions for the sysadm/update class: "listlogs" and "readlogs";
REST Request (example):
-------------------------------
PUT /sysadm/update
{
"action" : "listlogs"
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"name" : "update",
"args" : {
"action" : "listlogs"
},
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"listlogs": {
"pc-updatemanager.log": {
"finished": "1484127618",
"name": "pc-updatemanager.log",
"started": "1484127618"
},
"pc-updatemanager.log.prev": {
"finished": "1484109171",
"name": "pc-updatemanager.log.prev",
"started": "1484109171"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
===================================
REST Request (example):
-------------------------------
PUT /sysadm/update
{
"logs" : [
"pc-updatemanager.log"
],
"action" : "readlogs"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"namespace" : "sysadm",
"name" : "update",
"args" : {
"logs" : [
"pc-updatemanager.log"
],
"action" : "readlogs"
}
}
Response:
-------------------------------
{
"args": {
"readlogs": {
"pc-updatemanager.log": "pc-updatemanager: Tue Jan 10 23:32:51 EST 2017\nChecking for updates to ports-mgmt/pkg..\nUpdating the package repo database...\nCleaning old pkg upgrade cache...\n<Shortened For Example>\nDetermine new BE name...\nCleanup mounts..."
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2017-01-12 12:57:40 -05:00
Ken Moore
8da65605c2
Add a new setting to the update manager specifically for SysAdm:
...
"auto_update_reboot" = "0"-"23" (hour of the day)
If this is set (to a valid number), then SysAdm will automatically reboot the system to finish performing updates at the specified hour. Any other setting (or the value not being set) disables this option.
2016-10-25 14:02:26 -04:00
Ken Moore
2099f39d58
Add the auto-update hooks directly into the sysadm server.
...
Now the automatic 15 minute health checks will startup the update process if the autoupdate option is set rather than relying on anacrontab.
2016-10-25 12:41:06 -04:00
Ken Moore
6924dad755
When making changes to the update manager repo/url - clear out the last check for updates so the next ping will re-check using the new settings.
...
Also remove some old comments from the service manager.
2016-09-19 09:50:43 -04:00
Ken Moore
0408f61f4c
API CHANGE
...
Add the "is_running" output field to the sysadm/services "list_services" output.
This also cleans up the is_enabled detection routine so it should be more reliable.
2016-08-30 13:32:53 -04:00
Ken Moore
200a7de9e0
API CHANGE
...
Add a new output field to the sysadm/updates "check for updates".
args:{
"details":"<details about updates>"
}
2016-08-30 10:04:30 -04:00
Ken Moore
ee1627b505
Fix up the fast/full update check backend. It looks like the QDateTime.addSecs() function is not working properly on Qt 5.5.1 - switch to the .secsTo() function instead when looking for the amount of time between the file modification and current time.
2016-08-10 12:48:43 -04:00
Ken Moore
12ba560fd6
API CHANGE
...
Add a new field in the output args for the sysadm/updates check for updates:
"last_check":"<ISO date/time stamp>"
This returns the timestamp the last time a "full" check was performed (since some checks are flagged as quick/automatic and just re-use the previous check unless a significant amount of time has passed first - 12 hours is what it is set to right now).
2016-08-10 11:45:52 -04:00
Ken Moore
a2bba87315
API CHANGE
...
Add a new API call to the sysadm/update class:
"action":"changesettings"
This allows for changing the various updatemanager settings (maxbe, package_set, package_url, auto_update)
REST Request (example):
-------------------------------
PUT /sysadm/update
{
"action" : "changesettings",
"maxbe" : "6"
}
WebSocket Request:
-------------------------------
{
"id" : "fooid",
"name" : "update",
"namespace" : "sysadm",
"args" : {
"maxbe" : "6",
"action" : "changesettings"
}
}
Response:
-------------------------------
{
"args": {
"changesettings": {
"result": "success"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-08-09 13:22:46 -04:00
Ken Moore
4457397733
API CHANGE
...
Add a new API call to the sysadm/update class for reading all the current settings.
REST Request (example):
-------------------------------
PUT /sysadm/update
{
"action" : "listsettings"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "listsettings"
},
"id" : "fooid",
"namespace" : "sysadm",
"name" : "update"
}
Response:
-------------------------------
{
"args": {
"listsettings": {
"maxbe": " 5",
"package_set": " EDGE"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-08-09 12:45:27 -04:00
Ken Moore
06c71afa4a
API CHANGE: Add a new "stopupdate" action for the sysadm/update class. (no additional inputs required).
...
This will look for any currently-running pc-updatemanager processes and kill/stop them as needed.
Example:
{
"id":"dummy",
"namespace":"sysadm",
"name":"update",
"args": {
"action":"stopupdate"
}
}
Output arguments:
"args":{
"stopupdate":{
"result":"success" or "error:<error text>"
}
}
2016-08-09 11:27:08 -04:00
Ken Moore
d430de0fce
API CHANGE:
...
Remove the "fbsdupdate" and "fbsdupdatepkgs" options within the sysadm-update API call for starting an update. These options are no longer available with base pkgs (everything is run through the "pkgupdate" option instead).
2016-08-09 10:51:14 -04:00
Ken Moore
b7273f7e19
Make sure that when starting updates via sysadm - it will remove the temporary/last update log file so the next check is forced to re-run.
2016-04-05 10:22:37 -04:00
Ken Moore
36b30e6c9c
Finish cleaning up the new "pending" state for dispatcher processes.
2016-04-05 10:19:05 -04:00
Ken Moore
7566f1396e
Add a new "fast" mode to the sysadm-update check for updates (re-use previous update info), and setup the regular health check to report update information using this fast mode.
2016-03-24 08:58:29 -04:00
Ken Moore
0bf67bbe06
Fix the update process detection command - needs a return code of 0 to tell if there is a process running.
2016-03-23 14:34:21 -04:00
Ken Moore
3060c9906d
Finish fixing up the sysadm/update server backend. Now updates can properly be started and the other update flags are detected/used as needed.
2016-03-21 14:14:51 -04:00
Ken Moore
cf8cf0d429
Add a "updaterunning" status to the sysadm/update check for updates, and also setup sysadm/update to emit dispatcher events about the update process.
2016-03-21 13:08:13 -04:00
Ken Moore
638f0eb390
Fix a couple bugs in the sysadm/update check routine. Now it will report "rebootneeded" when the system is waiting to reboot to apply updates, and it allows for multiple "patch" entries now.
2016-03-18 15:16:02 -04:00
Kris Moore
62465ad03e
Add the 'startupdate' API call which allows you to queue a
...
system update
Valid args:
target : "chbranch/pkgupdate/fbsdupdate/fbsdupdatepkgs/standalone"
branch: "newbranch" - (Only used with chbranch target)
tag: "pkgng-1.6.9" - (Only used with standalone target)
REST Request:
-------------------------------
PUT /sysadm/update
{
"action" : "startupdate",
"target" : "pkgupdate"
}
REST Response:
-------------------------------
{
"args": {
"startupdate": {
"queueid": "611c89ae-c43c-11e5-9602-54ee75595566",
"command": "pc-updatemanager pkgupdate",
"comment": "Task Queued"
}
}
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "startupdate",
"target" : "pkgupdate"
},
"name" : "update",
"id" : "fooid",
"namespace" : "sysadm"
}
WebSocket Response:
-------------------------------
{
"args": {
"startupdate": {
"queueid": "611c89ae-c43c-11e5-9602-54ee75595566",
"command": "pc-updatemanager pkgupdate",
"comment": "Task Queued"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-02-01 13:21:17 -05:00
Ken Moore
1146b14917
Cleanup the library/server interactions for sysadm: Now the "library" directory is just an internal collection of classes/files, rather than an actual library of system calls. This allows for in-server globals usage (such as the dispatcher/events systems) within the library files as needed.
2016-02-01 12:29:25 -05:00