unissoft-bj / ihostsvc

system services & data services on ihost
0 stars 0 forks source link

管理中心测试问题 系统时间 #88

Open unissoft-bj opened 9 years ago

unissoft-bj commented 9 years ago

系统时间

ihost向前端提供当前的系统时间,此处缺一个rest

https://github.com/unissoft-bj/ihostsvc/issues/78 GET http://localhost:8080/secure/resource

return json: { id: 1 content: "欢迎使用Matrix WIFI, 88-88-88-FF-FF-88!" now: "2015-06-02 09:29:34" }

设置系统时间,测试情况

前端先ihost发送的command正常,ihost处理command正常

2015-06-02 19:15:13.892 INFO [http-nio-8080-exec-5] --- net.wyun.wm.rest.admin.AdminController : configure ihost now: sudo /root/ihostset.sh systime local '2015-06-02 19:08:05' 2015-06-02 19:15:13.908 DEBUG [http-nio-8080-exec-5] --- o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally 2015-06-02 19:15:13.908 DEBUG [http-nio-8080-exec-5] --- s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed

2015-06-02 19:15:57.214 INFO [http-nio-8080-exec-9] --- net.wyun.wm.rest.admin.AdminController : configure ihost now: sudo /root/ihostset.sh systime ntp 202.120.2.101 2015-06-02 19:16:00.217 DEBUG [http-nio-8080-exec-9] --- o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally 2015-06-02 19:16:00.217 DEBUG [http-nio-8080-exec-9] --- s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed

2015-06-02 19:15:12.195 INFO [http-nio-8080-exec-10] --- net.wyun.wm.rest.admin.AdminController : configure ihost now: sudo /root/ihostset.sh systime ntp 2015-06-02 19:15:15.197 DEBUG [http-nio-8080-exec-10] --- o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally 2015-06-02 19:15:15.200 DEBUG [http-nio-8080-exec-10] --- s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed

使用local time时,系统时间不更新 使用ntp时,系统时间有时候更新,有时候不更新 更新系统时间,调用ihostset.sh表现不稳定,是否直接用java写?

michaelyin commented 9 years ago

http://stackoverflow.com/questions/6203857/how-can-i-set-the-system-time-in-java

use local time to update the system time. The command need be admin or running as sudo.

unissoft-bj commented 9 years ago

有可能的问题:单引号造成 sudo /root/ihostset.sh systime local '2015-06-02 19:08:05'