Did you (or a startup script) set the environment variable R_HISTORY to be
'~/somefile'?  R does not expand the tilde in this case so you need to let
the shell do it.  Perhaps ~ doesn't expand for the root user.  (IMO, it is
crazy to run R, or almost any other program, as root.)

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Wed, Jun 26, 2019 at 7:11 AM lejeczek via R-help <r-help@r-project.org>
wrote:

> hi guys,
>
> I'm on Centos 7.6 with R 3.6 and I see this:
>
> >
> Save workspace image? [y/n/c]: y
> Warning message:
> problem in saving the history file '~/.Rhistory'
>
> from strace:
>
> rt_sigaction(SIGWINCH, {SIG_DFL, [], SA_RESTORER, 0x7fb9dd34b5d0},
> {0x7fb9dc383820, [], SA_RESTORER|SA_RESTART, 0x7fb9dd34b5d0}, 8) = 0
> rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
> rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
> ioctl(1, TCXONC, TCOON)                 = 0
> open("~/.Rhistory", O_WRONLY|O_CREAT|O_TRUNC, 0600) = -1 ENOENT (No such
> file or directory)
> brk(NULL)                               = 0x43da000
> brk(0x43fe000)                          = 0x43fe000
> rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7fb9dcfa2280},
> {0x7fb9dfd99ffb, [INT], SA_RESTORER|SA_RESTART, 0x7fb9dd34b5d0}, 8) = 0
> rt_sigaction(SIGQUIT, {SIG_IGN, [], SA_RESTORER, 0x7fb9dcfa2280},
> {SIG_DFL, [], SA_RESTORER, 0x7fb9dd34b5d0}, 8) = 0
> rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
> clone(child_stack=0, flags=CLONE_PARENT_SETTID|SIGCHLD,
> parent_tidptr=0x7ffd7d87e100) = 1367359
> wait4(1367359, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 1367359
> rt_sigaction(SIGINT, {0x7fb9dfd99ffb, [INT], SA_RESTORER|SA_RESTART,
> 0x7fb9dcfa2280}, NULL, 8) = 0
> rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x7fb9dcfa2280}, NULL,
> 8) = 0
> rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
> --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1367359,
> si_uid=0, si_status=0, si_utime=0, si_stime=1} ---
> write(2, "Warning message:\n", 17)      = 17
> write(2, "problem in saving the history fi"..., 50) = 50
> exit_group(0)                           = ?
> +++ exited with 0 +++
>
>
> This only with user "root", and the some root can touch the ~/.Rhistory
> just fine.
>
> Even this works:
>
> > system(command="touch ~/.Rhistory")
>
> Would have any suggestions, ideas on how to fix it?
>
> many thanks, L.
>
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to