Jon*_*mon 4 time timezone r rstudio rstudio-server
我在带有 RHEL 7.6 的 AWS 服务器上运行带有 R 3.5.1 的 RStudio 1.1.456(请参阅下面的 sessionInfo)。我第一次(每个会话)调用 Sys.timezone() 时出现错误:
> Sys.timezone()
Failed to query server: Connection timed out
[1] "America/Chicago"
Warning message:
In system("timedatectl", intern = TRUE) :
running command 'timedatectl' had status 1
Run Code Online (Sandbox Code Playgroud)
随后它运行良好:
> Sys.timezone()
[1] "America/Chicago"
Run Code Online (Sandbox Code Playgroud)
但是 system("timedatectl") 继续失败:
> system("timedatectl", intern = TRUE)
Failed to query server: Connection timed out
character(0)
attr(,"status")
[1] 1
Warning message:
In system("timedatectl", intern = TRUE) :
running command 'timedatectl' had status 1
Run Code Online (Sandbox Code Playgroud)
从命令行,据我所知,一切都很好:
# timedatectl
Local time: Fri 2019-02-22 11:18:14 CST
Universal time: Fri 2019-02-22 17:18:14 UTC
RTC time: Fri 2019-02-22 17:18:13
Time zone: America/Chicago (CST, -0600)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
Sun 2018-11-04 01:59:59 CDT
Sun 2018-11-04 01:00:00 CST
Next DST change: DST begins (the clock jumps one hour forward) at
Sun 2019-03-10 01:59:59 CST
Sun 2019-03-10 03:00:00 CDT
# chronyc sources
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* time.richiemcintosh.com 2 6 377 82 -405us[ -364us] +/- 33ms
^+ pool-173-71-69-215.cmdnn> 1 7 377 18 -1828us[-1828us] +/- 56ms
^+ vps5.ctyme.com 2 6 377 82 +972us[ +972us] +/- 66ms
^+ mirror1.sjc02.svwh.net 2 7 377 18 +2250us[+2250us] +/- 61ms
Run Code Online (Sandbox Code Playgroud)
更新:它也可以直接从命令行中的 R 正常工作。它仅在 Rstudio 中失败。
我还应该尝试什么?我不明白为什么 system("timedatectl") 的行为与命令行中的 timedatectl 如此不同。
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1 yaml_2.2.0
Run Code Online (Sandbox Code Playgroud)
这修复了它:
# grep timedated /var/log/audit/audit.log | audit2allow -M timedated
******************** IMPORTANT ***********************
To make this policy package active, execute:
semodule -i timedated.pp
# semodule -i timedated.pp
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5582 次 |
| 最近记录: |