RHEL

Best practice to run Linux service as a different user

落花浮王杯 提交于 2019-11-27 04:09:45
问题 Services default to starting as root at boot time on my RHEL box. If I recall correctly, the same is true for other Linux distros which use the init scripts in /etc/init.d . What do you think is the best way to instead have the processes run as a (static) user of my choosing? The only method I'd arrived at was to use something like: su my_user -c 'daemon my_cmd &>/dev/null &' But this seems a bit untidy... Is there some bit of magic tucked away that provides an easy mechanism to automatically

JavaWeb 项目与系统时间相差 8 个小时的问题

丶灬走出姿态 提交于 2019-11-27 03:43:35
写在前面 今天记录分享一个排查部署到 Linux 上的 web 项目执行的时间和本地系统时间相差 8 小时的问题 环境:redhat 6.5 考虑有规律的时间差可能和时区不同有关 1 查看 Linux 系统时间和时区 [root@localhost ~]# date 2019年 03月 31日 星期日 16:00:32 CST [root@localhost ~]# date -R Sun, 31 Mar 2019 16:00:44 +0800 [root@localhost ~]# date +"%Z %z" CST +0800 从这里可以确定,系统的时间和时区正常(北京时间,也就是东八区),时区详情请看 这里 2 查看 jvm 时间和时区 2.1 先在 Linux 上某个目录执行 javac ,看 javac 命令是否可用,出现如下显示就可以(中间部分已省略) [root@localhost test]# javac 用法: javac <options> <source files> 其中, 可能的选项包括: -g 生成所有调试信息 -g:none 不生成任何调试信息 -g:{lines,vars,source} 只生成某些调试信息 ...... -X 输出非标准选项的提要 -J<标记> 直接将 <标记> 传递给运行时系统 -Werror 出现警告时终止编译 @<文件名>

DB2数据库从Linux备份到Win7里还原

谁都会走 提交于 2019-11-27 03:39:18
概述: 用 db2look + db2move 进行数据库迁移 涉及的两个操作系统: Redhat6.5 win7 [db2inst @localhost ~]$ uname -a Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux [db2inst @localhost ~]$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.5 (Santiago) 涉及的数据库版本: Linux下为 express-c 10.5 Win7 下为 express-c 11.1 [db2inst @localhost ~]$ db2 (c) Copyright IBM Corporation 1993,2007 Command Line Processor for DB2 Client 10.5.5 (c) Copyright IBM Corporation 1993,2007 DB2 客户机 11.1.3.3 的命令行处理器 Redhat6.5是一个专用的数据库机器。 参考文章: Linux下导出db2数据库还原到windows下

Installing Python 3 on RHEL

我的梦境 提交于 2019-11-27 02:33:41
I'm trying to install python3 on RHEL using the following steps: yum search python3 Which returned No matches found for: python3 Followed by: yum search python None of the search results contained python3. What should I try next? It is easy to install it manually: Download (there may be newer releases on Python.org ): $ wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tar.xz Unzip $ tar xf Python-3.* $ cd Python-3.* Prepare compilation $ ./configure Build $ make Install $ make install OR if you don't want to overwrite the python executable (safer, at least on some distros yum needs

Can't start Cassandra after OS patch up

只愿长相守 提交于 2019-11-27 02:13:10
问题 When I try to start Cassandra after patching my OS, I get this error: Exception (java.lang.AbstractMethodError) encountered during startup: org.apache.cassandra.utils.JMXServerUtils$Exporter.exportObject(Ljava/rmi/Remote;ILjava/rmi/server/RMIClientSocketFactory;Ljava/rmi/server/RMIServerSocketFactory;Lsun/misc/ObjectInputFilter;)Ljava/rmi/Remote; java.lang.AbstractMethodError: org.apache.cassandra.utils.JMXServerUtils$Exporter.exportObject(Ljava/rmi/Remote;ILjava/rmi/server

Linux VirtualBox安装及使用指南

大兔子大兔子 提交于 2019-11-27 01:50:24
VirtualBox是一款虚拟机软件。虽然它的功能并不及VMware Workstation Pro,但它对开源精神的坚持使得它在Linux中依然深受欢迎。 唯一难以令人接受的是,VirtualBox的安装步骤较为复杂。不过,VirtualBox的开发者已给出了解决方案(原文为英文: Linux_Downloads – Oracle VM VirtualBox ): 基于Debian的Linux 将以下行添加到/etc/apt/sources.list。根据你的发行版的代号,将<mydist>替换为相应的发行版名称(支持旧版VirtualBox不同的发行版) deb https://download.virtualbox.org/virtualbox/debian <mydist> contrib 之后,下载并注册 wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | apt-key add - wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | apt-key add - 安装VirtualBox apt-get update apt-get install virtualbox-5.2

Suppressing the “Picked up _JAVA_OPTIONS” message [closed]

谁说胖子不能爱 提交于 2019-11-27 01:32:48
I'm using _JAVA_OPTIONS to set some defaults for Java on RHEL. It works fine but now every time I start java I get the following message Picked up _JAVA_OPTIONS: -foo -bar -baz is it possible to keep the options but suppress the display of this message. jtahlborn From looking at the relevant source code ( arguments.cpp in openjdk, line 2492 ), there is no way to control the output of this message. The only thing I could say is that it is printed to stderr . So you could wrap your commands to redirect stderr to /dev/null (if there wasn't anything else you cared about on stderr ). Or write a

How to redirect output of systemd service to a file

喜欢而已 提交于 2019-11-26 21:16:22
I am trying to redirect output of a systemd service to a file but it doesn't seem to work: [Unit] Description=customprocess After=network.target [Service] Type=forking ExecStart=/usr/local/bin/binary1 agent -config-dir /etc/sample.d/server StandardOutput=/var/log1.log StandardError=/var/log2.log Restart=always [Install] WantedBy=multi-user.target Please correct my approach. Valerio Versace I think there's a more elegant way to solve the problem: send the stdout/stderr to syslog with an identifier and instruct your syslog manager to split its output by program name. Use the following properties

ubuntu命令行模式与图形桌面切换方法

喜你入骨 提交于 2019-11-26 20:28:21
ubuntu命令行模式与图形桌面切换方法 嵌入式软件开发需要依赖Linux操作系统,常用的Linux操作系统发行版包括ubuntu、redhat、fedora、centos等。下面将介绍ubuntu命令行模式与图形桌面切换方法。 ubuntu拥有强大的图形桌面,对于习惯使用windows系统工程师而言,一般都会选择使用ubunbu进行软件开发。有些工程师习惯了命令模式开发,同样ubuntu也提供了命令行模式。图形桌面登入界面如图1所示,命令行模式登入界面如图2所示,图形桌面登入后界面如图3所示。 图1 图形桌面登入界面 图2 命令行模式登入界面 图3 图形桌面窗口 PS:图形桌面与命令行模式相关切换快捷键 --------------------- 作者:yanlaifan 来源:CSDN 原文:https://blog.csdn.net/yanlaifan/article/details/53907104 版权声明:本文为博主原创文章,转载请附上博文链接! 来源: oschina 链接: https://my.oschina.net/u/4000302/blog/3045584

rhel8.0 beta 版 vmware15 无法识别到硬盘的解决办法

耗尽温柔 提交于 2019-11-26 18:46:08
下载介质, vmware 上安装,vmware 15.0,可是,怎么也不能找到 硬盘 ,不会吧 赶紧上网搜索,原来是 vmware 15.0,还没有做好对 rhel8.0的支持, 目前vmware的版本还无法识别RHEL8 beta版本的驱动情况,需要修改虚拟机的硬盘驱动。首先点击 vmware 页面上的关闭客户机按钮先关闭这个虚拟机 1.关闭虚拟机 2. 修改虚拟机和磁盘配置文件 然后打开虚拟机的安装目录,比如我这里是D:\SZTECH8。我安装虚拟机时取的名字是SZTECH8,所以在里面找两个文件,SZTECH8.vmx和SZTECH8.vmdk。如下所示: 找到后,在文件上点击右键,使用文件编辑器打开,在SZTECH8.vmx里面找到scsi0.virtualDev,它的默认值是lsilogic,如下面第二张图中所示 把它改成pvscsi,如下面图中所示,修改完成后保存退出。 同样的,打开SZTECH8.vmdk文件,将里面的ddb.adpterType修改为pvscsi,然后保存退出 修改为: 然后点击启动虚拟机,重新进入安装流程,这个时候就可以检测到你配置的 硬盘 了。如下面第二张图中所示: 按以上步骤修改后,问题搞定。 来源: oschina 链接: https://my.oschina.net/u/3635497/blog/2964162