RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1710925 - exits with exit code 2 in kde.csh
Summary: exits with exit code 2 in kde.csh
Keywords:
Status: CLOSED DUPLICATE of bug 1738491
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kde-settings
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jan Grulich
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-16 15:06 UTC by chun-liang.lin
Modified: 2023-10-06 18:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-12 09:02:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description chun-liang.lin 2019-05-16 15:06:57 UTC
Description of problem:

We must run the csh scripts with -e (csh exits if any invoked command terminates abnormally or yields a non-zero exit status)

the script exits in /etc/profile.d/kde.csh with exit code 2

For example :  csh -Xec '/bin/true && echo true'

Output : 
if ( -r /etc/profile.d/colorls.csh ) then
if ( 0 ) then
source /etc/profile.d/colorls.csh
endif
endif
end
if ( -r /etc/profile.d/kde.csh ) then
if ( 0 ) then
source /etc/profile.d/kde.csh

> echo $status
2

Version-Release number of selected component (if applicable):

All of the RHEL 7 has the same issue. It's ok in RHEL 6.

How reproducible:

Steps to Reproduce:
1. Install the kde-settings packages in RHEL 7
2. run the command csh -Xec '/bin/true && echo true'
3. echo the $status

Actual results:

$status = 2

Expected results:

$status = 0

Additional info:

Comment 2 chun-liang.lin 2019-05-16 15:12:19 UTC
Check the script in /etc/profile.d/kde.csh

## When/if using prelinking, avoids use of kdeinit
if ( ! $?KDE_IS_PRELINKED ) then
  grep -qs -qs '^PRELINKING=yes' /etc/sysconfig/prelink && \
  setenv KDE_IS_PRELINKED 1
endif

The kde.csh In RedHat 6, 

## When/if using prelinking, avoids use of kdeinit
if ( -f /etc/sysconfig/prelink ) then
   set PRELINKING = `grep "^PRELINKING=" /etc/sysconfig/prelink | cut -d"=" -f2`
   if ( "$PRELINKING" == "yes" )  then
     if ( ! $?KDE_IS_PRELINKED ) setenv KDE_IS_PRELINKED 1
   endif
   unset PRELINKING
endif

The code in RedHat 6 should be the better one.

Comment 4 Thomas Klar 2019-08-30 12:56:54 UTC
I ran into this same problem:

RHEL 7.7

kde-settings-19-23.9.el7.noarch

[root@pc12894 ~]# tcsh -X
...
if [ ! -d /root/.local/share -a -w /root ] then
if: Expression Syntax.


Checking /etc/profile.d/kde.sh and kde.csh , the 2 files have the same if at the end:

# Fix the user-places.xbel error pop at first user login
if [ ! -d ${HOME}/.local/share -a -w ${HOME} ] then
    mkdir -p ${HOME}/.local/share
endif

That is bash syntax. I'm a bash guy, don't really know csh, but with some help from google, this syntax seems to work for the kde.csh :

if ( ! -d ${HOME}/.local/share && -w ${HOME} ) then
    mkdir -p ${HOME}/.local/share
endif

Comment 5 Akemi Yagi 2019-08-30 14:28:21 UTC
This bug is being tracked for 7.7 in RHBZ #1738491 .

Comment 6 Bryan Wright 2019-08-30 14:48:34 UTC
I'm seeing the same problem with the final "if" statement in /etc/profile.d/kde.csh.  This is fairly serious because it also prevents users' own login files from being processed: the error in kde.csh prevents the execution of subsequent scripts in the login process.

As noted above, the correct syntax should be:

# Fix the user-places.xbel error pop at first user login
if ( ! -d ${HOME}/.local/share && -w ${HOME} ) then
    mkdir -p ${HOME}/.local/share
endif


Note You need to log in before you can comment on or make changes to this bug.