Go Premium for a chance to win a PS4. Enter to Win

x

Unix OS

32K

Solutions

18K

Contributors

Unix is a multitasking, multi-user computer operating system originally developed in 1969 at Bell Labs. Today, it is a modern OS with many commercial flavors and licensees, including FreeBSD, Hewlett-Packard’s UX, IBM AIX and Apple Mac OS-X. Apart from its command-line interface, most UNIX variations support the standardized X Window System for GUIs, with the exception of the Mac OS, which uses a proprietary system.

Share tech news, updates, or what's on your mind.

Sign up to Post

Instead using root account, sysadmins in our company use RBAC  to run commands on AIX systems. The steps are:
- log as user
- load RBAC'r role
- execte commands

Les see an example how username user1 run cmd1 with RBAC sysadmin_role loaded:

- SSH to AIX system as user1                          # log to system
$ swrole sysadmin_role                                # comamnd to load  RBAC's the sysadmin_role
 user1's Password:                                    # It prompts for user1 password  
                                                     # type user1's password
$ cmd1                                               # Every command run here is run with RBAC's role loaded

Open in new window

.

Now we want to use ansible to do the same task.  As it's not sudo we can not use ansible's become privilege escalation feture. So, my question is:
- Using Ansible, how can we run cmd1 with RBAC role swrole sysadmin_role loaded?

Thanks.
0
Ask an Anonymous Question!
LVL 11
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Hello,
i need to process lots of small text files (1k to ~1M in size) millions per day.
they are syslogs files. the processing logic can be summarized in: filter out unwanted lines.
i did some tests with: cat File | grep -v bla | grep -v foo | grep -v bar > File.2
and i get huge space and clearness benefits. But the piping have some limits, after 20 not good any more :)
i'm not a day to day programmer, but kept playing around over the years.
i know/remember C,C++,Perl, some basic bash, started to learn Python some years back. i see that the fancy thing now is Go :)
do any of the language would offer a performance plus or minus, in this scenario? or the limiting factor for all will be the disk access?
Thank you for your thoughts

Ciprian
0
Hello,

We have netapp FAS storage and we would like to share the storage to some of the UNIX servers using NFS and windows machine using CFS.  is it possible to share the same FS to UNIX and Windows?
0
Hello,

We have netapp  FAS storage and we have created the network interface and NFS file systems are mounted using that network interface.  Can we create another network interface use the NFS ?

For an example  servers are using  192.168.10.105 to mount NFS file system and 192.168.10.105 is netapp interface.  IF I create another network interface and assign IP address  172.10.10.25 in netapp, then can I use either 192.168.10.105 or  172.10.10.25 in client?
0
We have a DEC 3000 server with SCSI hard disc and Unix 4 OS. Recently when the system was booted, I am getting an error : 84 Fail; T_ERR_SCSI-CHECK_BOOTBLOCK. Please help to resolve the issue
0
Hello,

We have few Linux servers and that has connected to 2-3 vlans and  that has NFS file system mounted from different server. For an example NFS server is registered with 192.168.10.x, that is where all the our production payload traffic goes. We would like to move NFS traffic to different Vlan like 172.10.10.X. Since many of them are using NFS servers, we don't want to change the DNS name, but I was planning to add new IP and hostname in the /etc/hosts file, so it would take local /etc/hosts entry rather than going through DNS.

Basically I want all the NFS traffic to be go through  172.10.10.X
0
hi,
i wrote simple perl script and trying to run geting below error from


https://www.tutorialspoint.com/unix_terminal_online.php

sh-4.4$ vi hi.pl                                                                                                                                                                            
sh-4.4$ pwd                                                                                                                                                                                  
/home/cg/root                                                                                                                                                                                
sh-4.4$ /home/cg/root/hi.pl                                                                                                                                                                  
sh: /home/cg/root/hi.pl: Permission denied                                                                                                                                                  

i just wrote in hi.pl as
print "hii";


in command prompt of windows it ran fine once i install activevperl
https://www.activestate.com/activeperl/downloads

C:\Users\ss\perl\code>perl hello.pl
hii

please advise
0
winscp wht is difference between location profiles and bookmarks

/crm/home/xyz2abc/exp/net/ccfg/crm

i have above book mark
i have to give a name to it saying "server1 config property file path"
i see rename option under location profiles not under bookmarks
but location profile again shows local directory and remote directory
what that means?

i am confused
https://winscp.net/eng/docs/ui_locationprofile
also under book marks what is difference between site book marks and shared book marks

https://winscp.net/eng/docs/ui_opendir

please advise
0
hi,
mputty session name how to rename says from server1 to server2

Please advise
0
Hi Experts,

We have been working on a script which scans through  xml files and pulls out information like database name, databaseServername etc from multiple xml files.

I am attaching sample xmls which are used by script to scan.

The script is as follows:
nohup timeout 15 cat context.xml
        sleep 10
        cat nohup.out|grep -i "driverClassName="|grep -i oracle >/dev/null 2>&1
 if [ $? -eq 0 ]
  then
        OUr=`cat nohup.out|grep url=|awk -F= '{print $2}'`
        DS=`echo $OUr|awk -F: '{print $4}'|sed s/@//g`
        DB=`echo $OUr|awk -F: '{print $NF}'|sed s/\".*//g`
        DB1=`echo $DB|sed s/\".*//g`

else
        DS=`cat nohup.out |grep url=|grep jdbc|head -1|awk -F/ '{print $3}'|awk -F";" '{print $1}'|awk -F":" '{print $1}'`
        DB=`cat nohup.out |grep url=|grep jdbc|head -1|awk -F";" '{print $2}'|awk -F= '{print $2}'|sed s/\".*//g`
        Ru=`cat nohup.out|grep "Environment name"|grep PegaRULES|awk '{print $3}'|awk -F= '{print $2}'|sed s/\"//g`
   if [ -z "$Ru" ]
    then
        Ru=`cat nohup.out|grep username=|awk -F= '{print $2}'|sed s/\"//g`
   fi
 fi

Open in new window


This works for 90 percent of cases which have only one Resource Name (example: context_works.xml and context_works2.xml)

But, in 10 percent of xmls when there are multiple resources (like context_doesnotwork.xml), it doesnt picks the right one, due to the oracle grep check, but I would like to be able to pick the resource which has the name=jdbc/PegaRULES.(It picks Oracle instead of picking the resource with name jdbc/PegaRULES). I would like to eliminate resources other than the ones with name=jdbc/PegaRULES before the grep for Oracle in the file.
Is there a way by which I can do that without losing much of the current logic?
context_works.xml
context_works2.xml
context_doesnotwork.xml
0
[Webinar] Cloud and Mobile-First Strategy
LVL 11
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

what is difference between control D and exit commands.

please advise
0
hi,
my super user is crm and password is say pwd

sudo crm and sudo su means same or different

what is passwd comand, cut c ommand?
please advise
0
hi,

i created aaa file under gp foler under root of tutorialpoint



sh-4.4$ /bin/bash                                                                                                                                                                            
bash-4.4$ [wd                                                                                                                                                                                
bash: [wd: command not found                                                                                                                                                                
bash-4.4$ pwd                                                                                                                                                                                
/home/cg/root                                                                                                                                                                                
bash-4.4$ mkdir gp                                                                                                                                                                          
bash-4.4$ pwd                                                                                                                                                                                
/home/cg/root                                                                          …
0
hi,

what is difference between mv vs cp

when we use which one. any advantage of using one over other

please advise
0
Hello,
We have two Solaris-10 x86 servers with below details, both are on VMWare -
bad-server - 4 GB memory and 2 vCPU
good-server - 16 GM memory and 4 vCPU

There is an application running on both servers, which query something and read from a file. Queries are failing on bad-server, while good-server is fine. If I check sar reports on bad-server, total memory utilization is never going higher than 30%.

Upon further investigation, we see that once PID 1243 (this is process id of that application) consumes 900 MB of RSS (from prstat output), queries starts failing. We attached that PID with truss and found below line
/1243:   1.6180 open("/export/correctaddress/data/ltravel.wrk", O_RDONLY) = 23

Open in new window

It takes more than one second, and this fails the query, while on good-server, it takes around 0.030 seconds. When this happens, application should be restarted and then total RSS would be 100 MB. After couple of hours, it would be 300 MB, then 500 MB and once it will hit near 900 MB, queries will again fail. This makes application has to be started every 7-8 hours. Can somebody explain this, when memory consumption is never reaching over 30% ? We would have increased its CPU and memory to match good server, but it should tell us, if it crossing threshold value.
Thanks in advance.
0
I am keep getting these messages in my log file.  What does it mean?


Oct 30 13:25:01 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 11faa83
Oct 30 13:40:36 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 121b627
Oct 30 13:40:36 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 121b628
Oct 30 13:41:56 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 1224b24
Oct 30 13:41:56 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 1224b29
Oct 30 13:42:36 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 1226243
Oct 30 13:42:36 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 1226244
Oct 30 13:42:36 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 1226245
Oct 30 13:42:36 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 1226246
Oct 30 13:42:36 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 122629d
Oct 30 13:42:36 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 122629e
Oct 30 13:46:46 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 122e814
Oct 30 14:21:20 appserver1 corosync[26011]: [TOTEM ] Retransmit List: 123cee4
0
hi,

i got new server ip session. I need to add this to mputty/tabbed puty. How to add it. Please advise step by step procedure for it.
0
i have a code like this

#!/bin/ksh

exit()
{
echo "leaving the function "
exit $1 ## should call builtin function
}

if [ ${AUTORUN} = "Y" ]
then
echo "cannot AUTORUN"
exit 1      #should call user defined function
else
echo "can AUTORUN"
fi


is it possible to do it ?
0
7. Highlighting the search using GREP_OPTIONS

As grep prints out lines from the file by the pattern / string you had given, if you wanted it to highlight which part matches the line, then you need to follow the following way.

When you do the following export you will get the highlighting of the matched searches. In the following example, it will highlight all the this when you set the GREP_OPTIONS environment variable as shown below.

$ export GREP_OPTIONS='--color=auto' GREP_COLOR='100;8'

$ grep this demo_file
this line is the 1st lower case line in this file.
Two lines above this line is empty.
And this is the last line.
http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/

how to get different color when search match comes?
please advise
0
Free Tool: Subnet Calculator
LVL 11
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

As below   recursive search not working for me
http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/

$ grep -r "ramesh" *

please advise
0
winscp shows server name i gave like puppy but not putty or mputty which gives some host name.

how to see in putty /mputty server name at the top of the window as putty not some meaning less host etc thing which i do not understand?
0
hi,
what it mean by unix is multi user environment? what exactly that means?
how the number of link to a file say 5 in below command

ls -l

is related to multi user environment.


why newly created dir has 2 links where as file has 1
please advise
0
what is stats command, what are different options i can use with taht?
0
hi,

I connnected to one production inace went to the log directory where bunch of log files there.

how to continuosly monitor logs for any possible errors , exceptions.

how frequently new files created?
do i have to do vi command to open the log file

please advise
0
On SLES 12.2 I do the following as root user:

mkdir -p /some/directory/ramdisk
chown -R simpleuser:users /some
chmod 777 /some/directory
chmod 777 /some/directory/ramdisk

Open in new window


Then I add this to /etc/fstab:
ramfs /some/directory/ramdisk ramfs defaults 0 0

Open in new window

followed by
mount /some/directory/ramdisk

Open in new window


What I expect is a ramfs mounted to /some/director/ramdisk, owned by simpleuser and users, with permissions set to 777.

Surprisingly, after rebooting the machine, the owner of /some/director/ramdisk is root:root, and the permissions have changed to something more restrictive. I deem that more of a feature  than a bug, but that behaviour is really annoying in the environment I use it in.

Currently I do an explicit change of ownership and permissions prior to starting the application that uses the ramdisk (in the respective script, with sudo), but I deem that not very elegant.

Any hint what causes the changes, and how to prevent them ?
0

Unix OS

32K

Solutions

18K

Contributors

Unix is a multitasking, multi-user computer operating system originally developed in 1969 at Bell Labs. Today, it is a modern OS with many commercial flavors and licensees, including FreeBSD, Hewlett-Packard’s UX, IBM AIX and Apple Mac OS-X. Apart from its command-line interface, most UNIX variations support the standardized X Window System for GUIs, with the exception of the Mac OS, which uses a proprietary system.